这是我的表的 LaTeX 代码:
\begin{table}{| c || c | c | c || c | c | c | }
\caption{Examples of the concepts. \label{tab:conceptsimgs}}\\
\hline
\backslashbox{Concept}{Class} &\multicolumn{3}{|c||}{Negative Class} & \multicolumn{3}{|c|}{Positive Class} \\
\hline
\forloop{themenumber}{1}{\value{themenumber} < 4}{
%\hline
\arabic{themenumber}
\forloop{classnumber}{0}{\value{classnumber} < 2}{
\forloop{imagenumber}{1}{\value{imagenumber} < 4}{
& 0
}
}
\\
\hline
}
\end{table}
然而结果有些不对劲。表末尾有一些额外的内容,如下所示:
http://www http://www。免费图像托管。网/image.php?c702bfc838.png
我该如何修复它?
那是一件令人讨厌的事情。我创建了一个演示该问题的最小示例,请参见下文。尝试编译它并查看结果。
关键是,你似乎不走运——tabular
不喜欢的输出forloop
,它不能忽略最后一个\addtocounter
命令。也许你可以找到一些其他的循环包。
您应该能够从下面的代码中找出其余部分,如果没有,请写下评论。
\documentclass{article}
\usepackage{forloop}
\newcounter{themenumber}
\newcounter{test}
\begin{document}
% this is your table (minimal example)
\begin{tabular}{| c |}
\forloop{themenumber}{1}{\value{themenumber} < 2}{x\\ \hline}
\end{tabular}
\vspace{2cm}
% this is what you wanted to have
\begin{tabular}{| c |}
x \\ \hline
\end{tabular}
\vspace{2cm}
% this is what forloop produces
\begin{tabular}{| c |}
x \\ \hline \addtocounter{test}{1}
\end{tabular}
\end{document}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)