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

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

\documentclass[11pt,a4paper,oneside]{report}
\begin{document}
\title{Practical Typesetting}
\author{Peter Flynn\\Silmaril Consultants}
\date{January 2016}
\maketitle
\end{document}


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.

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. This command 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 in their own document classes, in the knowledge that anything like that done before the \maketitle command will be honoured.

One extra command show here is the double backslash (\\), which is the LATEX command for a premature (forced) linebreak. LATEX normally decides by itself where to break lines, and it’s usually right, but sometimes you need to cut a line short, like here, and start a new one. I could have left it out and just used a comma, so the name and company would all appear on the one line, but I just decided that I wanted the company name on a separate line. In some publishers’ document classes, they provide a special \affiliation command to put your company or institution name in instead.

The most common use of the double backslash in the \author command is for separating multiple authors, so I don’t recommend that you do what I did here except for draft or experimental purposes.

When this file is typeset, you get something like Figure 2.1 (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.

Exercise 3: Adding the 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.

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 § C.3 to resolve this.