,

Numbering in LaTeX documents

Manuscripts typically contain many different types of numbering: page numbering, sections, subsections, figures, tables etc. Types of counters Each counter has a different name that is used to modify them. This is typically slightly different from the one that is used to create a new item. For sections, for example, \section{Header Text} is used to…

Manuscripts typically contain many different types of numbering: page numbering, sections, subsections, figures, tables etc.

Types of counters

Each counter has a different name that is used to modify them. This is typically slightly different from the one that is used to create a new item. For sections, for example, \section{Header Text} is used to generate a new section, but its counter name is section. The current value of any of those can be printed in your LaTeX document by writing (e.g.) \thesection, \theequation, etc. (in fact, typically you label specific values and refer to those, such as \section{This is my first section heading\label{sec:1}} and refer to it by writing “In Section \ref{sec:1}, I present…”

Partpart
Chapterchapter
Sectionsection
Subsectionsubsection
Subsubsectionsubsubsection
Paragraphparagraph
Equationequation
Figurefigure
Tabletable
Pagepage
Footnotefootnote
Built-in counters

Adding and substracting from counters

If you want, for example, to reset table and figure counters so that they restart with 1, you can simply write

\setcounter{figure}{0}

so that the next Figure is “Figure 1”.

Alternatively, you can also change counters relative to the current value by adding to (or substracting from) through addtocounter

\addtocounter{page}{2}

Changing layout of counters

Regarding the layout of counters, there are two important elements to it: first, which numbering style do you like, i.e. roman, alphabetic (upper, lower case) or arabic? Second, do you prefer a period right after the number or even sections included in the name (say Figure 1.1 for the first figure in Section 1)?

To change the numbering style, you can simply use the following code by writing:

\renewcommand{\thepage}{\roman{page}}

For appendices, for example, you might first want to number A, B, etc.

\renewcommand{\thesubsection}{\Alph{subsection}}

and then to include the “A”, “B” etc. in the Figure and Table numbering (so that those are distinct from those in the main text). You can simply do to by adding the following code before the appendix appears in your LaTeX code:

\renewcommand{\thetable}{\thesubsection.\arabic{table}}

In my papers, for example, I use the following lines after the references (and before any appendix text):

\clearpage 

\setcounter{page}{1}
\setcounter{table}{0}
\setcounter{figure}{0}
\setcounter{equation}{0}
\renewcommand{\thepage}{\roman{page}}
\renewcommand{\thefigure}{\thesubsection.\arabic{figure}}
\renewcommand{\thetable}{\thesubsection.\arabic{table}}
\renewcommand{\theequation}{\thesubsection.\arabic{equation}}

\section*{Online Appendix}

Leave a Reply