LaTex 表编号
如何根据文章章节中的表格对表格进行编号?所以我希望第五部分中的所有表格都编号为“Table 5.1”,...,“Table 5.n”。
我尝试过
\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{table}{section}
\counterwithin{equation}{section}
,但遇到了一些问题(我猜缺少软件包)。
但是,我需要一个更简单的解决方案,而不需要使用此类包。
How could I number the tables in my article chapter based ? So I want all the tables in the fifth section to be numbered like "Table 5.1", ..., "Table 5.n".
I tried
\usepackage{chngcntr}
\counterwithin{figure}{section}
\counterwithin{table}{section}
\counterwithin{equation}{section}
but I am having some problems (missing package I guess).
However, I need a simpler solution, without the need to use such packages.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Article 类没有章节。尝试书籍或报告类 - 您会发现表格和图形会根据章节自动编号。
The article class doesn't have chapters. Try the book or report classes - you'll find that the tables and figures are automatically numbered according to chapter.
这是一个不使用任何包的解决方案(由“The Latex Companion”,A1.4 提供):
每当启动新部分时,这都会重置表计数器,并将其格式化为
sectionno.tableno
而不仅仅是tableno
。您可以类似地更改figure
和equation
计数器。如果您使用
amsmath
包(或像amsart
这样自动加载它的 AMS 类),您可以使用这是为方程创建的,但适用于任何计数器对尽管据说可能存在一些棘手的情况,但它不能很好地处理。
Here is a solution without the use of any package (courtesy of "The Latex Companion", A1.4):
This resets the table counter whenever a new section is started, and formats it as
sectionno.tableno
instead of justtableno
. You can change thefigure
andequation
counters similarly.If you are using the
amsmath
package (or an AMS class likeamsart
that loads it automatically), you can useThis was created for equations, but works for any pair of counters though supposedly there might be tricky situations that it does not handle well.