5

I'm new to TeX (and I'm still trying to get my hear around it.)

I was wondering is there a package that automatically creates links within the document I am writing - like hyperlinking from the table of contents to the specific sections, or citations to the bibliographic data?

Thanks!

2
8

The hyperref package will automatically generate hyperlinks for the table of contents and citations. Be sure to add \usepackage{hyperref} to your document preamble after loading any other packages, since hyperref makes some serious changes to the internals of LaTeX- there are some exceptions, which are detailed in Which packages should be loaded after hyperref instead of before?

An example document might look like

\documentclass{article}
\usepackage{lipsum}
% add any other packages here.
\usepackage{hyperref}

\title{My Document}
\author{A. U. Thor}

\begin{document}
\maketitle
\tableofcontents

\section{A Section}
This section will automatically be added to the table of contents, as normal. The table of
contents entry for this section will automatically hyperlink to it. Also, a PDF bookmark
will be added.

\section{Another Section}
\lipsum

\end{document}
1
  • 3
    If, like me, you find the boxes that hyperlink puts around its links to be impossibly ugly then you can instead make the text of the links an arbitrary color in the fashion of the following example: \usepackage[colorlinks=true,linkcolor=black,citecolor=yellow,filecolor=magenta,urlcolor=cyan]{hyperref}
    – Ubiquitous
    Jul 30 '13 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.