Documentation/Document Structure/How to Make a Table of Contents in LaTeX
Document Structure

How to Make a Table of Contents in LaTeX

LaTeX automatically generates a table of contents from your section headings. Just use \tableofcontents.

Basic Table of Contents

Add \tableofcontents after \maketitle:

\begin{document}
\maketitle
\tableofcontents

\section{Introduction}
\section{Methods}
\subsection{Data Collection}
\section{Results}
\end{document}

Control Depth

Limit how deep the TOC goes:

\setcounter{tocdepth}{2}  % sections and subsections only
% 0=chapters, 1=sections, 2=subsections, 3=subsubsections

List of Figures and Tables

Add these after the table of contents:

\tableofcontents
\listoffigures
\listoftables

Add Entry Manually

Add custom entries to TOC:

\addcontentsline{toc}{section}{Appendix A}

💡 Tips

  • •Compile twice to generate the TOC (LaTeX needs two passes)
  • •Use \section*{} for unnumbered sections that don't appear in TOC
  • •Add \newpage after \tableofcontents to start content on a new page

Try This in Bibby AI

Write LaTeX faster with AI auto-complete and instant compilation.

Start Writing Free

Related Tutorials

How to Make a Table of Contents in LaTeX | Bibby AI