TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I use


I get colored links for \cite (not good for printing or even viewing) but table of content looks fine.

If I use


I get \cite links in black with a colored frame (this looks very good) but the table of content looks strange with extra long boxes.

What are my other options? Can you have two styles in different parts of a document?

How do you make the page numbers in TOC to be the links instead of the section headers?

share|improve this question
To answer my own last question, use \usepackage[colorlinks=false, linktocpage=true]{hyperref} to avoid those long boxes in TOC. See link for details. – Maesumi Apr 5 '12 at 0:29
related: tex.stackexchange.com/questions/98528/… – craq Dec 28 '15 at 17:50
\usepackage[hidelinks]{hyperref} More here – devasood May 5 at 9:17
up vote 77 down vote accepted

You can customise pretty much any thing in that regard, all the way to hiding all the links (no colours, no frames, just plain black text) with hidelinks.

if you use colorlinks=true you can set (defaults in []):

  • linkcolor [red]
  • anchorcolor [black]
  • citecolor [green]
  • filecolor [cyan]
  • menucolor [red]
  • runcolor [cyan - same as file color]
  • urlcolor [magenta]
  • allcolors -- use this if you want to set all links to the same color

if you want some of these not coloured, simply set them to black.

if you use colorlinks=false and therefore want the frames around the links you have access to these settings:

  • citebordercolor [rgb 0 1 0]
  • filebordercolor [rgb 0 .5 .5]
  • linkbordercolor [rgb 1 0 0]
  • menubordercolor [rgb 1 0 0]
  • urlbordercolor [rgb 0 1 1]
  • runbordercolor [rgb 0 .7 .7]
  • allbordercolors

again if you want some of these to not appear, set them to white.

In your case, if you want the frames around links in citations but not on the table of content (and therefore not on other links such as to figures, tables or footnotes) I suggest you have a \hypersetup configuration with at least:

    colorlinks = false,
    linkbordercolor = {white},
    <your other options...>,
share|improve this answer
Thx! \hypersetup{ hidelinks = true, } worked for me to keep link functionality, but print them black (without frames) – OneWorld Sep 6 '12 at 23:59
@OneWorld hidelinks does not take on any values. You just include the option or you don't. In particular, no Boolean modifier... – kan Oct 9 '12 at 2:42
@Sampath: Thank you, I will consider that next time I use this command. However, as I remember the extra value did not break anything. So, for the record: \hypersetup{ hidelinks, } is correct. – OneWorld Oct 12 '12 at 12:47
Works like a charm, what a life- (and money-) saver :) – fotNelton Nov 2 '15 at 6:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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