我不明白为什么这里不能有标题:
\begin{table}[H]
\begin{tabular}{cc}
\hline
\textbf{Ejemplo 3} & \includegraphics[width=8cm,height=4cm]{figura/07.jpg} \\
\includegraphics[width=6cm,height=4cm]{figura/07_1.jpg} & \includegraphics[width=6cm,height=4cm]{figura/07_2.JPG} \\
\hline
\textbf{Foto 7} & \includegraphics[width=8cm,height=4cm]{figura/48.jpg}\\
\includegraphics[width=6cm,height=4cm]{figura/48_1.jpg} & \includegraphics[width=6cm,height=4cm]{figura/48_2.JPG}\\
\hline
\label{casosop2}
\end{table}
\caption{caption}
\end{tabular}
我收到以下错误:
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.84 \end{table}
如果我删除标题行,就不会出现任何问题。
答案1
有几件事:
分组遵循层次结构:如果你打开一个
table
,里面有一个tabular
,那么你必须关闭tabular
前关闭table
。你
\caption
应该在table
环境中,而不是在里面tabular
。就是这样,除非你使用longtable
。放置您的
\label
后这\caption
(而不是在 内tabular
)。以下是生成表格的内容:
\documentclass{article}
\usepackage{graphicx,float}
\begin{document}
\begin{table}[H]
\begin{tabular}{cc}
\hline
\textbf{Ejemplo 3} & \includegraphics[width=8cm,height=4cm]{example-image-a} \\
\includegraphics[width=6cm,height=4cm]{example-image-b} & \includegraphics[width=6cm,height=4cm]{example-image-c} \\
\hline
\textbf{Foto 7} & \includegraphics[width=8cm,height=4cm]{example-image-a}\\
\includegraphics[width=6cm,height=4cm]{example-image-b} & \includegraphics[width=6cm,height=4cm]{example-image-c}\\
\hline
\end{tabular}
\caption{caption}
\label{casosop2}
\end{table}
\end{document}