7 Titles and Contents

7.1 Title Pages

You can define a title for your document using \title{} and then create the title itself using \maketitle. You can also add other information such as the author(s) and the date, e.g.

\documentclass[12pt,draft]{book}

\title{A Beginner's Guide to \LaTeX}
\author{Phil Hasnip}
\date{\today}

\begin{document}
\maketitle

Note the use of \today to automatically insert the date you created the document. Of course you can just write a date if you prefer!

7.2 Contents

To add a table of contents, simply add \tableofcontents to your document, e.g.

\begin{document}
\tableofcontents
\chapter{Introduction}

\end{document}

You can also use \listoffigures to show all the figures in your document (see later).

7.3 Page Numbering

Up to this point we've been using LaTeX's default page numbering. Under most circumstances this is fine, but for the first few pages, such as the contents and title pages, you might want something a bit different.

Exercise 7

Add a title page and table of contents to your document.

Summary


Previous page Next page