Previous: , Up: Table of contents etc.   [Contents][Index]

25.1.6 \numberline



Typeset its argument flush left in a box. This is used in a \contentsline command to typeset the section number (see \contentsline).

For example, this line in a .toc file causes the 1 to be typeset flush left.

\contentsline {subsection}{\numberline {1.1}Motivation}{2}

By default, LaTeX typesets the section numbers in a box of length \@tempdima. That length is set by the commands \l@section, \l@subsection, etc. Put section numbers inside a natural-width box with \renewcommand{\numberline}[1]{#1~}.

This command is fragile, so you may need to precede it with \protect (see \protect). An example is the use of \protect in the command \addcontentsline{toc}{section}{\protect\numberline{}Summary} to get the \numberline into this command in the .toc file: \contentsline {section}{\numberline {}Summary}{6} (the page number ‘6’ is automatically added by LaTeX; see \addcontentsline).

Unofficial LaTeX2e reference manual