Table of contents

To create the table of contents is straightforward, the command \tableofcontents does the job. Sections, subsections and chapters are included in the table of contents. To manually add entries, for example when you want an unnumbered section, use the command \addcontentsline as shown in the following example:

\documentclassarticle> \usepackageblindtext> \usepackagetitlesec> \titleSections and Chapters> \authorGubert Farnsworth> \date > \begindocument> \maketitle \tableofcontents \sectionIntroduction> This is the first section. \blindtext \addcontentslinetoc>section>Unnumbered Section> \section*Unnumbered Section> \blindtext \sectionSecond Section> \blindtext \enddocument> 

This example produces the following output:

Example table of contents produced in LaTeX

Change the title of the table of contents

The default title for the table of contents is Contents; it can be changed into whatever you need as the following example demonstrates:

\documentclassarticle> \titleSections and Chapters> \authorGubert Farnsworth> \date > \renewcommand*\contentsnameSummary> \begindocument> \maketitle \tableofcontents \sectionIntroduction> This is the first section. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortisfacilisis sem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdietmi nec ante. Donec ullamcorper, felis non sodales. \addcontentslinetoc>section>Unnumbered Section> \section*Unnumbered Section> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi necante. \sectionSecond Section> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisissem. Nullam nec mi et neque pharetra sollicitudin. Praesent imperdiet mi necante. \enddocument> 

This example produces the following output:

Changing name for table of contents in LaTeX

The line \renewcommand*\contentsname will write "Summary" instead of the default value. If you are using the package babel for international language support, the aforementioned command must be placed inside the braces of

\addto\captionsenglish > 

Instead of English in \captionenglish write the name of the language you set in babel.

Further reading

For more information see:

Overleaf guides

LaTeX Basics

Mathematics

Figures and tables

References and Citations

Languages

Document structure

Formatting

Fonts

Presentations

Commands

Field specific

Class files

Advanced TeX/LaTeX