Time for action – titling your document

We will take the first example and insert some commands that will produce a nice-looking title.

  1. Type the following code in the editor; modify the previous example if you like:
    \documentclass[a4paper,11pt]{article}
    \begin{document}
    \title{Example 2}
    \author{My name}
    \date{January 5, 2011}
    \maketitle
    \section{What's this?}
    This is our second document. It contains a title and a section with text.
    \end{document}
  2. Click the Typeset button.
  3. View the output:
    Time for action – titling your document

What just happened?

In the first chapter, we talked about logical formatting. First, let's look at this example from that point of view. We told LaTeX that:

  • Our document ...

Get LaTeX Beginners Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.