Graphics, Figures & Tables ⇒ Table numbering in Appendices
Table numbering in Appendices
Hi!
I've just converted some articles to the new Elsevier class and suddenly the appendices are all weird. I want to have appendices numbered A, B and so on, with tables numbered A.1, A.2, B.1.... which worked very well before. Now it continues table numbering from main document.
I managed to get it to have A, B etc in front of the table numbers by using the appendix-package, but it still continues on the main table numbering (A.7, A.8, B.9) instead of restarting.
Does anyone have an idea of how to get around this?
//Elisabeth
I've just converted some articles to the new Elsevier class and suddenly the appendices are all weird. I want to have appendices numbered A, B and so on, with tables numbered A.1, A.2, B.1.... which worked very well before. Now it continues table numbering from main document.
I managed to get it to have A, B etc in front of the table numbers by using the appendix-package, but it still continues on the main table numbering (A.7, A.8, B.9) instead of restarting.
Does anyone have an idea of how to get around this?
//Elisabeth
NEW: TikZ book now 40% off at Amazon.com for a short time.

- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Table numbering in Appendices
Hi Elisabeth,
you could use \numberwithin of the amsmath package (especially if you're already using amsmath) or \counterwithin of the chngcntr package to number tables per section or chapter, like
This way the table counter would restart each section (or chapter in the other case), here it would start with the section number, in the case of the appendix A.1, B.1, ...
Stefan
you could use \numberwithin of the amsmath package (especially if you're already using amsmath) or \counterwithin of the chngcntr package to number tables per section or chapter, like
Code: Select all
\numberwithin{table}{section}
Stefan
LaTeX.org admin
Re: Table numbering in Appendices
That almost but not quite does it. It resets the numbering, but includes the "Appendix" in the numbering, e.g. "Table Appendix A.1". Same for both \numberwithin and \counterwithin.
//Elisabeth
//Elisabeth
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Table numbering in Appendices
I would not include "Appendix" directly in the representation of the section counter like this document or class seems to do. But it could be corrected for tables by
Stefan
Code: Select all
\renewcommand*\thetable{\Alph{section}.\arabic{table}}
LaTeX.org admin
Re: Table numbering in Appendices
That works. 
Thanks a lot for the help!
//Elisabeth

Thanks a lot for the help!
//Elisabeth
Table numbering in Appendices
Also, you would probably like to reset the counter to zero, isn't it?
Otherwise the first table in the appendix will be numbered, say, Table A.13 if the last table in the main text body is Table 12.
Code: Select all
\setcounter{table}{0}
\renewcommand\thetable{\Alph{section}.\arabic{table}}
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Re: Table numbering in Appendices
Hi davidec,
welcome to the board!
If \numberwithin or \counterwithin like suggested above is used resetting the counter to 0 won't be necessary, it would be reset already at the beginning of every section.
Otherwise one would have to repeat this reset command at the beginning of appendix section B etc.
Stefan
welcome to the board!
If \numberwithin or \counterwithin like suggested above is used resetting the counter to 0 won't be necessary, it would be reset already at the beginning of every section.
Otherwise one would have to repeat this reset command at the beginning of appendix section B etc.
Stefan
LaTeX.org admin
Table numbering in Appendices
Stefan, thanks for your kind welcome!
In fact, that's the most common situation I can think of: say, a 20-page paper with 5 sections, where numbering the tables by section would be kind of an overkill. But in such a case, you may still want the tables in the appendix to be numbered distinctly.
I agree. On the other hand, one may want the tables to be numbered throughout in the main body of the article, independently of the section (and not Table 1.1, 2.1, and so on), while numbered differently when it comes to the appendix. That's what I was trying to achieve with the counter reset.If \numberwithin or \counterwithin like suggested above is used resetting the counter to 0 won't be necessary, it would be reset already at the beginning of every section.
In fact, that's the most common situation I can think of: say, a 20-page paper with 5 sections, where numbering the tables by section would be kind of an overkill. But in such a case, you may still want the tables in the appendix to be numbered distinctly.