3

How can I make the hyperlinks appear in blue? I am forced to use some preamble and this is what I found there:

\usepackage[driverfallback=dvipdfm,hyperfootnotes=false]{hyperref}

Hyperlinks are supposed to appear in blue by default but it does not for my document.

2
  • 5
    \hypersetup{colorlinks=true,linkcolor=blue}?
    – user31729
    Apr 10, 2017 at 19:26
  • 2
    Package hyperref has options for this, \usepackage[colorlinks=true,linkcolor=somecolor,citecolor=somecolor]{hyperref} Apr 10, 2017 at 20:33

1 Answer 1

6

Either use options when calling \usepackage{hyperref} or \hypersetup later on (Please note, that not all options of hyperref can be given multiple times in \hypersetup again, but the color options are repeatable!)

\documentclass{book}

% Load with some options, i.e. \usepackage[colorlinks=true,linkcolor=blue]{hyperref} or blank
\usepackage{hyperref}


% Change the setup later on, after loading hyperref

\hypersetup{colorlinks=true,linkcolor=blue, linktocpage}

\begin{document}

\tableofcontents


\clearpage

See \ref{foo} or \ref{foobar} for more information!

\chapter{Foo} \label{foo}

\chapter{Foobar} \label{foobar}
\end{document}

The screen shows the ToC with blue hyperlinks to the chapters.

enter image description here

If the linktocpage option is given as suggested by AlexG, the page numbers in ToC are made hyperlinks to the relevant chapter etc, as can be seen in the following screen shot:

enter image description here

2
  • 1
    Not directly related to the question, but I would always use colorlinks in combination with linktocpage.
    – AlexG
    Apr 11, 2017 at 12:25
  • @AlexG: Yes, thanks, I would not use the ToC entry names as links as well. I've added your suggestion to the post.
    – user31729
    Apr 11, 2017 at 17:40

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.