Showing posts with label table of tables. Show all posts
Showing posts with label table of tables. Show all posts

Friday, May 29, 2009

Table of contents in LaTeX

LaTeX has an ability to produce table of contents automatically for the whole document. Table of contents contain the section numbers and corresponding headings, together with the page numbers on which they begin. This article gives some introduction on generating and printing the table of content, as well as list of figures and tables in LaTeX.

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}{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.
\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 \caption command in the figure and table environments.