Adding metadata

The PDF standard contains a field for hidden descriptive data, such as the name of the author and the title of a document. This is useful for archiving purposes. Internet search engines also inspect metadata information. In this recipe, we will edit it.

How to do it...

We will use the interface of the hyperref package. Let's again use our examples from Chapter 1, The Variety of Document Types. Let's take a look at the following steps:

  1. Open the book example from Chapter 1, The Variety of Document Types, in your editor.
  2. At the end of the preamble, load the hyperref package:
    \usepackage{hyperref}
  3. Set up the metadata information. Here, we use some dummy text:
    \hypersetup{pdfauthor = The Author, pdftitle = The Book, pdfsubject = Draft version, ...

Get LaTeX Cookbook 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.