LaTeX Counters
Everything LaTeX numbers for you has a counter associated with it. The
name of the counter is the same as the name of the environment or
command that produces the number, except with no \. Below is a list
of the counters used LaTeX's standard document styles to control
numbering.
| part | part | figure | enumi
|
| chapter | subparagraph | table | enumii
|
| section | page | footnote | enumiii
|
| subsection | equation | mpfootnote | enumiv
|
| subsubsection
|
Here are the commands to be used with counters:
\addtocounter{counter}{value}
The command increments the counter by the amount
specified by the value argument. The value argument can be negative.
\alph{counter} \Alph{counter}
This command causes the value of the counter to be printed in
alphabetic characters. The \alph command causes lower case alphabetic
alphabetic characters, i.e., a, b, c... while the \Alph command causes
upper case alphabetic characters, i.e., A, B, C...
\arabic{counter}
The \arabic command causes the value of the counter to be printed in
arabic numbers, i.e., 3.
\fnsymbol{counter}
The \fnsymbol command causes the value of the counter to be printed in
a specific sequence of nine symbols that can be used for numbering
footnotes.
\newcounter{foo}[counter]
The \newcounter command defines a new counter named foo. The optional
argument [counter] causes the counter foo to be reset whenever the
counter named in the optional argument is incremented.
\roman{counter} \Roman{counter}
This command causes the value of the counter to be printed in roman
numerals. The \roman command causes lower case roman numerals, i.e.,
i, ii, iii..., while the \Roman command causes upper case roman
numerals, i.e., I, II, III...
\setcounter{counter}{value}
The \setcounter command sets the value of the counter to that
specified by the value argument.
\usecounter{counter}
The \usecounter command is used in the second argument of the
list
environment to allow the counter specified to be used to number the
list items.
\value{counter}
The \value command produces the value of the counter named in the
mandatory argument. It can be used where LaTeX expects an integer or
number, such as the second argument of a \setcounter or \addtocounter
command, or in
\hspace{\value{foo}\parindent}
It is useful for doing arithmetic with counters.
Back to the main LaTeX page.