Sections in LaTeX
LaTeX structures documents with \section, \subsection, and deeper heading commands — all automatically numbered.
Quick answer
latex
\section{Introduction}
\subsection{Background}
\subsubsection{Prior Work}Heading hierarchy
LaTeX provides seven levels of sectioning. The available levels depend on the document class.
| Command | Level | Available in |
|---|---|---|
| \part{} | -1 | book, report |
| \chapter{} | 0 | book, report |
| \section{} | 1 | all classes |
| \subsection{} | 2 | all classes |
| \subsubsection{} | 3 | all classes |
| \paragraph{} | 4 | all classes |
| \subparagraph{} | 5 | all classes |
Unnumbered sections
Add a * to suppress the number and exclude from the table of contents.
latex
\section*{Acknowledgements}
\subsection*{Note on Notation}
% To add an unnumbered section to the TOC manually:
\section*{Acknowledgements}
\addcontentsline{toc}{section}{Acknowledgements}Short title for TOC/header
Provide an optional short title in brackets for the table of contents and running headers.
latex
\section[Short Title]{Very Long Section Title That Would Overflow}Numbering control
latex
% Set section counter manually:
\setcounter{section}{4} % next \section will be 5
% Control numbering depth (e.g., don't number subsubsections):
\setcounter{secnumdepth}{2}
% Control TOC depth:
\setcounter{tocdepth}{2}