6 Sectioning

Structure your text into divisions: parts, chapters, sections, etc. All sectioning commands have the same form, one of:

sectioning-command{title}
sectioning-command*{title}
sectioning-command[toc-title]{title}

For instance, declare the start of a subsection as with \subsection{Motivation}.

The table has each sectioning-command in LaTeX. All are available in all of LaTeX’s standard document classes book, report, and article, except that \chapter is not available in article.

Sectioning unitCommandLevel
Part\part-1 (book, report), 0 (article)
Chapter\chapter0
Section\section1
Subsection\subsection2
Subsubsection\subsubsection3
Paragraph\paragraph4
Subparagraph\subparagraph5

All these commands have a *-form that prints title as usual but does not number it and does not make an entry in the table of contents. An example of using this is for an appendix in an article. The input \appendix\section{Appendix} gives the output ‘A Appendix’ (see \appendix). You can lose the numbering ‘A’ by instead entering \section*{Appendix} (articles often omit a table of contents and have simple page headers so the other differences from the \section command may not matter).

The section title title provides the heading in the main text, but it may also appear in the table of contents and in the running head or foot (see Page styles). You may not want the same text in these places as in the main text. All of these commands have an optional argument toc-title for these other places.

The level number in the table above determines which sectional units are numbered, and which appear in the table of contents. If the sectioning command’s level is less than or equal to the value of the counter secnumdepth then the titles for this sectioning command will be numbered (see Sectioning/secnumdepth). And, if level is less than or equal to the value of the counter tocdepth then the table of contents will have an entry for this sectioning unit (see Sectioning/tocdepth).

LaTeX expects that before you have a \subsection you will have a \section and, in a book class document, that before a \section you will have a \chapter. Otherwise you can get something like a subsection numbered ‘3.0.1’.

LaTeX lets you change the appearance of the sectional units. As a simple example, you can change the section numbering to uppercase letters with this (in the preamble):
\renewcommand\thesection{\Alph{section}} . (See \alph \Alph \arabic \roman \Roman \fnsymbol: Printing counters.) CTAN has many packages that make this adjustment easier, notably titlesec.

Two counters relate to the appearance of headings made by sectioning commands.

secnumdepth

Controls which sectioning unit are numbered. Setting the counter with \setcounter{secnumdepth}{level} will suppress numbering of sectioning at any depth greater than level (see \setcounter). See the above table for the level numbers. For instance, if the secnumdepth is 1 in an article then a \section{Introduction} command will produce output like ‘1 Introduction’ while \subsection{Discussion} will produce output like ‘Discussion’, without the number. LaTeX’s default secnumdepth is 3 in article class and  2 in the book and report classes.

tocdepth

Controls which sectioning units are listed in the table of contents. The setting \setcounter{tocdepth}{level} makes the sectioning units at level be the smallest ones listed (see \setcounter). See the above table for the level numbers. For instance, if tocdepth is 1 then the table of contents will list sections but not subsections. LaTeX’s default tocdepth is 3 in article class and  2 in the book and report classes.


Unofficial LaTeX2e reference manual