How to make a table of contents in Overleaf.
Type \tableofcontents where you want the contents page to appear, right after \maketitle or your abstract. LaTeX reads your \section, \subsection and \chapter commands automatically to build the list, but it needs two compilation passes to display page numbers correctly.
The short answer: put \tableofcontents where you want the list, write your sections as normal, and click Recompile twice. If the page is empty, your document needs a second pass or has only unnumbered headings.
Add a table of contents in three steps
Every standard document class builds the contents page from your structural headings without extra packages.
Steps to generate your contents
Place the command
Put \tableofcontents in the body of your document, right after the title block or abstract, where you want the contents page to sit.
\documentclass{article} \begin{document} \maketitle \tableofcontents \newpage \section{Introduction} This is the first section. \end{document}Write your sections
Use standard sectioning commands like \section{}, \subsection{}, and \chapter{} if you are using the report or book class. Each numbered heading goes into the contents file automatically.
\section{Background and motivation} \subsection{Related work}Recompile twice
Click Recompile in Overleaf. The first compilation pass writes section titles and page numbers to an auxiliary .toc file, and the second pass reads that file to print the list. Overleaf handles multiple passes automatically when using latexmk.
Control how many levels appear
Add unnumbered sections and front matter
Headings created with a star, such as \section*{Acknowledgements}, are left out of the table of contents because they lack numbers. If your university guide requires an unnumbered abstract, acknowledgement, or preface in the contents, you must add each entry manually using \addcontentsline.
Place the addition command directly below the starred heading so LaTeX records the correct page number.
Manual entry examples
Add an unnumbered section
Use \addcontentsline immediately after your starred heading to register it in the .toc file under the section level.
\section*{Acknowledgements} \addcontentsline{toc}{section}{Acknowledgements} This work was supported by...Add a chapter-level entry
For reports and books, change the second argument to chapter so the item formats correctly in the list.
\chapter*{Preface} \addcontentsline{toc}{chapter}{Preface} Before starting the main text...
Fixing common table of contents problems
The contents page shows only the heading
Your document has only compiled once. Click Recompile again so Overleaf can read the newly generated .toc file and print the entries.
The bibliography is missing from the contents
Standard classes do not add the bibliography automatically. If you use biblatex, pass the heading option to your print command: \printbibliography[heading=bibintoc]. If you use standard BibTeX, load the tocbibind package in your preamble with \usepackage[nottoc]{tocbibind}.
Titles are too long for the contents page
Provide a short title in square brackets before your full section heading. LaTeX puts the short version in the contents and running header while keeping the long title in the text: \section[Short title]{Full and descriptive title of the section}.
Questions
How do I make a table of contents in Overleaf?
Place \tableofcontents in your document where you want the list to appear, usually right after \maketitle or your abstract. Ensure your document has structured sections like \section{}, and click Recompile twice so LaTeX can generate and read the auxiliary .toc file.
Why is my table of contents empty in Overleaf?
An empty table of contents almost always means your document needs a second compilation pass. The first run creates the .toc helper file, and the second run reads it. Recompile a second time, or check that your document actually contains numbered sectioning commands.
How do I add unnumbered sections to the table of contents?
Try your own paper in Texeno.
Start free, upload a project as a .zip and press Recompile. Upgrade when you need longer compiles.
Start writing