59

How do I remove the red boxes from my hyperlinked table of contents created by using the hyperref package in LaTeX.

Kara
  • 6,115
  • 16
  • 50
  • 57
alamodey
  • 14,320
  • 24
  • 86
  • 112
  • 3
    For a broader question, see http://tex.stackexchange.com/questions/823/remove-ugly-borders-around-clickable-cross-references-and-hyperlinks – Waldir Leoncio Jan 14 '14 at 14:47

4 Answers4

65

To remove the borders:

\hypersetup{%
    pdfborder = {0 0 0}
}

The colorlinks option will turn on the link colors and also remove the borders. (This is why alamodey set all the link colors to black.)

godbyk
  • 8,359
  • 1
  • 31
  • 26
40
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black
}
alamodey
  • 14,320
  • 24
  • 86
  • 112
  • 1
    Thanks for this answer, now I can not only remove the border, but also define the colors of the links. – Kelvin Hu Mar 05 '13 at 06:38
  • Is there a way to set urlcolor to the color of the body text in which the link appears, rather than insisting that color is "black"? – cboettig Apr 14 '14 at 21:47
32

Version 6.82a of hyperref, released in February 2011, introduced a new hidelinks option that accomplishes this more easily. All you need now is:

\usepackage[hidelinks]{hyperref}
Jeffrey Barnes
  • 419
  • 4
  • 6
10

I realize it's a bit late to answer but there's a simpler way, in my experience

\usepackage[colorlinks=true]{hyperref}

This will shift hyperref from ugly borders to link coloring, which is what you usually want. See here for more options:

http://en.wikibooks.org/wiki/LaTeX/Hyperlinks

Kristoff vdH
  • 224
  • 2
  • 4