## 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.

• \pagestyle{empty} stops the pages being numbered
• \pagestyle{plain} this is the default; it puts the numbers at the bottom of the page
• \pagestyle{headings} puts the numbers at the top of the page; the precise style and content depends on the document class
• \pagenumbering{roman} numbers pages using Roman numerals; use arabic to switch it back

### Exercise 7

• You can define a document title, author and date with \title, \author and \date; they will only be typeset when you use the \maketitle command (inside the document environment)
• You can add a contents table with \tableofcontents
• You can add a list of figures with \listoffigures
• Page numbering is controlled by \pagestyle and \pagenumbering