Skip to main content


Within 'counters', LaTeX keeps track of numberings, like automatic title numbering and numbering of equations.


The current value of the subsection-counter can be printed in your document with \arabic{subsection}. However, this will always print the number in arabic numbers, but you might want to put it in roman numbers for example, or prepend the current section number or add diferent formatting. This formatting is done by \thesubsection.

See the following demo:

Counters: \thesubsection,
\arabic{subsection}, \roman{subsection}

Counters: \thesubsection,
\arabic{subsection}, \roman{subsection}

Counters: \thesubsection,
\arabic{subsection}, \roman{subsection}


You can change the value of the counter with \setcounter and \addtocounter: first you pass the name of the counter, followed by the new value or the amount to be added.


subsection: \arabic{subsection}


Title numbering doesn't use \addtocounter{section}{1} directly, but \refstepcounter. This increments the counter, but also resets the subsection counter, meaning you don't get 1, 1.1, 1.2, 2, 2.3, but 1, 1.1, 1.2, 2, 2.1. It also arranges that \label and \ref function properly.

Spare the formatting, you're now able to simulate \section and \subsection.

\textbf{\thesection, AA}

\textbf{\thesubsection, BB}

\textbf{\thesubsection, CC}

\textbf{\thesection, DD}

Zie Paragraaf \ref{sec:AA} en
Deelparagraaf \ref{sec:CC}.

\textbf{\thesubsection, DD}


With \meaning\thesubsection you can see how the formatting works: the command \thesubsection evaluates to \thesection.\@arabic\c@subsection, which is equivalent to \thesection.\arabic{subsection}.

If you now use


then 2.1 becomes (2)a and 5.3 becomes (5)c.


We just saw how you can change a number's formatting using \renewcommand. You could use this for example to preprend the equation number with the current section-number. That results in

But after a \section, the equation number just continues, so the next equation would be (3.20) instead of (3.1). As we have seen, \refstepcounter can perform automatic number resets, like it does for subsection-numbers. To enable the same feature for equations, we need to specify \counterwithin*{equation}{section}.

You can also use \counterwithin (without the star), which does everything automatically:

% is equivalent to:

To remove a counter from the reset list, you can use \counterwithout*. Without the star, the formatting itself will also be reset.

Available counters#

To list the counters which are by default defined, add the following code into your document:

\def\@elt #1{#1; }

It will print something like

page; equation; enumi; enumii; enumiii; enumiv; footnote; mpfootnote; part; section; subsection;subsubsection; paragraph; subparagraph; figure; table; parentequation

More to be added later#