Your support for our advertisers helps cover the cost of hosting, research, and maintenance of this document

Formatting Information — An introduction to typesetting with LATEX

Chapter 2: Basic structures

Section 2.3: Titling

The first thing you actually put in the document environment is almost always the document title, the author’s name, and the date (except in letters, which have a special set of commands for addressing). The title, author, and date are all examples of metadata (information about information).

\title{Practical Typesetting}
\author{Peter Flynn}
\date{January 2022}

The \title, \author, and \date commands are self-explanatory. You put the title, author name, and date in curly braces after the relevant command. The title and author are compulsory; if you omit the \date command, LATEX uses today’s date by default. If you don’t want a date at all, use \date{} (ie an empty date).

You MUST finish the metadata with the \maketitle command, which tells LATEX that it’s complete and it can typeset the titling information at this point. If you omit \maketitle, the titling will never be typeset.

Different title layouts

The \maketitle command, like all LATEX commands, is reprogrammable, so you can alter the appearance of titles (like I did for the printed version of this document). It also means publishers can create new commands like \datesubmitted and \editversion in their own document classes. Details about reprogrammability are in Chapter 7 ‘Programmability’ below.

When this file is typeset, you get something like Figure 2.1 below (I’ve cheated and done it in colour for fun — yours will be in black and white for the moment). This is a report, so the title appears all by itself on a single page.

Figure 2.1: Titling information typeset on the title page


Exercise 2.3 — Adding your metadata

  1. Add the \title, \author, \date, and \maketitle commands to your file.

  2. Use your own name, make up a title, and give a date.

  3. Typeset the document and check that it’s right.

The order of the first three commands is not important, but the \maketitle command must come last.

If you have mistyped a command, you may get an error message: see § B.3 below to resolve this.