Automation Tool - Hyperlinks

Automation Tool: Hyperlinks #

Author: Erhua

Keywords: Automation Tool, Hyperlinks

In this section, we discuss hyperlinks.

With the popularity of e-books, the role of hyperlinks is becoming more and more important. In general, the table of contents and labels in our documents should have hyperlink functionality.

We use the hyperref package for hyperlinks.

\usepackage{hyperref}

By using this package, when compiling the document, we can generate:

  • Hyperlinks for the table of contents automatically
  • Hyperlinks for cross-references automatically

The hyperref package has a \hypersetup command, which takes a dictionary-like key-value pair as its argument, in the following format:

\hypersetup{
  colorlinks = true,
  bookmarks = true,
}

Specific key-value pairs can be found in the package.

The \url command of hyperref can be used to output a hyperlink for a URL.

\url{http://www.google.com}
\href{url address}{text}    % Generates a hyperlink with the text pointing to the address
\hyperref[label content in cross-reference]{text}    % Generates a directional hyperlink with the text pointing to the cross-reference