\numberline
¶Synopsis:
\numberline{number}
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.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~}
before
\tableofcontents
.
This command is fragile so you may need to precede it with
\protect
(see \protect
). An example is the use of
\protect
in this command,
\addcontentsline{toc}{section}{\protect\numberline{}Summary}
to get the \numberline
into the \contentsline
command in the .toc file: \contentsline
{section}{\numberline {}Summary}{6}
(the page number ‘6’
is automatically added by LaTeX; see \addcontentsline
).