Sections, subsections and chapters in LaTeX
\section{Title} starts a numbered section, and \subsection and \subsubsection the levels below it. \chapter exists only in the classes report and book and their KOMA-Script counterparts.
The levels in an article
LaTeX numbers the headings and sets their font and spacing. \paragraph and \subparagraph are two more levels; in article they have no number and the text continues on the line of the heading.
\section{Introduction}
Text of the section.
\subsection{Background}
Text of the subsection.
\subsubsection{Earlier work}
Text of the subsubsection.
\paragraph{Remark}
The text continues on the same line as the heading.Chapters and parts
In report and book, \chapter is the level above \section and starts a new page. \part groups several chapters and does not reset the chapter number.
Complete document:
\documentclass{report}
\begin{document}
\part{Basics}
\chapter{Introduction}
\section{Motivation}
Text of the section.
\end{document}A short title for the table of contents
The optional argument is the version of the title that goes into the table of contents and the page header.
\section[Results]{Results of the second series of measurements}
Text of the section.Which levels get a number
The counter secnumdepth holds the lowest level that is numbered: 0 for chapters, 1 for sections, 2 for subsections, 3 for subsubsections, 4 for paragraphs. The default is 3 in article and 2 in report and book.
This goes into the preamble.
\setcounter{secnumdepth}{1}Pitfalls
\chapterin thearticleclass stops with an undefined control sequence. Switch toreportor start one level lower with\section.- Do not skip a level. A
\subsubsectiondirectly below a\sectiongets a number such as 1.0.1. - With
hyperref, a formula in a title produces the warning "Token not allowed in a PDF string", see Token not allowed in a PDF string (Unicode).
Compiled with pdfLaTeX from TeX Live 2023.