LaTeX 中的 forloop 和 table
这是我的表的 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。免费图像托管。 net/image.php?c702bfc838.png
我该如何修复它?
Here is the LaTeX code for my table:
\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}
Something is wrong in the result however. There is some extra thing at the end of the table, as shown in here:
http://www. freeimagehosting. net/image.php?c702bfc838.png
How can I fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
那是一件令人讨厌的事情。我创建了一个演示该问题的最小示例,请参见下文。尝试编译它并查看结果。
关键是,你似乎不走运 -
tabular
不喜欢forloop
的输出,它不能忽略最后一个\addtocounter
命令。也许你可以找到一些其他的循环包。您应该能够从下面的代码中找出其余部分,如果没有,请写下评论。
That's a nasty one. I've created a minimal example that demonstrates the problem, see below. Try to compile this and take a look at the results.
The point is, you seem to be out of luck —
tabular
does not like the output offorloop
, it cannot disregard the last\addtocounter
command. Maybe you can find some other package for loops.You should be able to figure out the rest from the code below, if not, write a comment.