Printing the table of contents
To display the table of contents, place the following command
\tableofcontents
at the location where the table of contents is to appear.To set the depth of table of contents, use the following command.
\setcounter{tocdepth}{the number of depth}
To add additional entry to the table of contents, use the following command.
\addcontentsline{toc}{section name}{entry text}\addtocontents{toc}{entry text}
For example, to include a *-form subsection named Preface in table of contents.
\subsection*{Preface}
\addcontentsline{toc}{subsection}{Preface}
To include reference or bibliography entry in table of contents, use the following command right before the bibliography command.
\addcontentsline{toc}{subsection}{Preface}
\addcontentsline{toc}{section}{References}
To produce roman style page number for the table of contents and arabic style page number for the rest of the documents, use the following command.
\pagenumbering{roman}
\tableofcontents
\newpage
\pagenumbering{arabic}
\tableofcontents
To change the title of table of contents, use the following command.
\tableofcontents
\newpage
\pagenumbering{arabic}
\tableofcontents
\renewcommand{contentsname}{New table of contents title}
List of figures and tables
Besides table of contents, LaTeX can also produce list of figures and tables automatically.The commands are
\listoffigures % to produce list of figures
\listoftables % to produce list of tables
The entries in these lists use the entries from the \listoftables % to produce list of tables
\caption
command in the figure and table environments.