Adding hyperlinks
At first, LaTeX was used to produce high-quality prints on paper. Since the output was device independent from the beginning, the results can be viewed on screens, tablets, and smartphones as well.
With electronic publishing, we get access to very handy features. Most importantly, hyperlinks, which allow us to easily navigate within a document. In this recipe, we will deal with providing hyperlinks in the PDF.
How to do it...
We will use the hyperref
package for providing hyperlinks in the PDF. It provides a user-friendly interface to access PDF features, such as hyperlinks. You can test it with our examples from Chapter 1, The Variety of Document Types, by performing the following steps:
Open the
book
example from the first chapter in your editor.At the end of the preamble, add this line for loading the
hyperref
package:\usepackage{hyperref}
Compile at least twice so that LaTeX can process the data in the
.aux
file written by thehyperref
package.Take a PDF viewer, such as...