UK TeX FAQ -- question label the-commands

### Redefining counters' `\``the-`commands

Whenever you request a new LaTeX counter, LaTeX creates a bunch of behind-the-scenes commands, as well as definining the counter itself.

Among other things, `\``newcounter{`fred`}` creates a command `\``the` `fred`, which expands to "the value of `fred`" when you're typesetting.

The definition of `\``the` `fred` should express the value of the counter: it is almost always always a mistake to use the command to produce anything else. The value may reasonably be expressed as an arabic, a roman or a greek number, as an alphabetic expression, or even as a sequence (or pattern of) symbols. If you need a decision process on whether to re-define `\``the` `fred`, consider what might happen when you do so.

So, for example, if you want your section numbers to be terminated by a period, you could make `\``thesection` expand with a terminating period. However, such a change to `\``thesection` makes the definition of `\``thesubsection` look distinctly odd: you are going to find yourself redefining things left, right and centre. Rather, use the standard techniques for adjusting the presentation of section numbers.

Or, suppose you want the page number to appear at the bottom of each page surrounded by dashes ("`-``- nnn -``-`"). Would you want to achieve this by redefining `\``thepage`, given the likely appearance of the table of contents with the dashes attached every page number, or of the modified `\``pageref` references. In this case, the modification is best done by redefining the page style itself, perhaps package fancyhdr.

This question on the Web: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=the-commands