I have been struggling to make a table of content to my thesis, can anyone help me with this? I was looking for a complete code where I could just put the names on the chapters and sections, but didnt manage to find. Help anyone?
1 Answers
You can customise your table of contents however you want, but it's very easy to set the basic one. I added \pagebreaks so that you can see how it automatically refers to the pages where each section starts. I suggest that you keep the page break after the TOC, however, since sections starting at the middle of the page after the list of chapters is not very good, typographically speaking.
Remember that you need to compile twice each time you change something (concerning the sections, like adding a new one, etc).
Of course, since it's automatic, if you add other languages, the title Contents will switch to the main language you set (and so many other options will). For example, adding \usepackage[french]{babel} will change it to Table des matières, [german] will change it to Inhaltsverzeichnis, [italian] to Indice, and so on.
Here's a small preview of the 3 pages:

And here's the code:
\documentclass[a4paper]{article}
\begin{document}
\tableofcontents
\pagebreak
\section{My first chapter}
blabla
\pagebreak
\section{another chapter}
\end{document}
- 37,338
\tableofcontents. LaTeX does the rest (compile twice). – Bernard May 19 '15 at 23:10\section{A section title}, that's all. – Bernard May 19 '15 at 23:15