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}. Each command is described in more
detail in the following sections.
The following table lists every 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 unit | Command | Level |
|---|---|---|
| Part | \part | −1 (book, report), 0 (article) |
| Chapter | \chapter | 0 |
| Section | \section | 1 |
| Subsection | \subsection | 2 |
| Subsubsection | \subsubsection | 3 |
| Paragraph | \paragraph | 4 |
| Subparagraph | \subparagraph | 5 |
All of 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 is given at the end of this section.
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, and so 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). Also, 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 your document to have a \section before any
\subsection and, in a book class document, to have
a \chapter before any \section. Otherwise the result
will be 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. The
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. The default tocdepth is 3
in article class and 2 in the book and report
classes.
Finally, an example of using a *-form is an appendix in an
article. The input
\appendix
\section{Appendix: More details}
gives the output ‘A Appendix: More details’ (see \appendix).
You can omit the number ‘A’ with \section*{Appendix: More
details}. (Articles typically omit a table of contents and have
simple page headers so the other differences from the \section
command often will not matter.)