25

I am using the natbib and hyperref packages in my LaTeX document and would like to change the colour of the box around the hyper-referenced citations from the baseline green to a more muted colour (violet or navy blue). However, in using the suggested code to do this, I cannot get the citation link colours to change. MWE:

\usepackage[usenames,dvipsnames]{color}
\usepackage[round]{natbib}
\usepackage[hyperfootnotes=false]{hyperref}
\hypersetup{
 colorlinks=false,
 citecolor=Violet,
 linkcolor=Red,
 urlcolor=Blue}

 \begin{document}

 \bibliographystyle{apsr}
 \bibliography{exp_final}
 \end{document}

However, when I compile (I compiled multiple times to make sure) my pdf file looks the same as if I had excluded the formatting in the \hypersetup (still the same green). I would also like to box the footnote citations as well.

Community
  • 1
  • 1
Thomas
  • 341
  • 2
  • 5
  • 6
  • 1
    You have a double `\usepackage[hyperfootnotes=false]{hyperref}` command in your code sample. You can safely remove one of them -- I suppose it's a copy/paste error. – Lohrun May 05 '10 at 08:07

1 Answers1

42

Actually the sample code you provided deactivate the link colorisation with the option colorlinks=false. You should use the following hyperref setup command that actually change links color.

\hypersetup{
  colorlinks,
  citecolor=Violet,
  linkcolor=Red,
  urlcolor=Blue}

To change box color around the links and citations, you have these other options :

\hypersetup{
  citebordercolor=Violet,
  filebordercolor=Red,
  linkbordercolor=Blue
}

Box appearance (specifically, width of PDF link border) is controlled by the pdfborder option. If the colorlinks option is set, boxes are deactivated (see the hyperref manual for more information).

Robson
  • 3
  • 3
Lohrun
  • 6,432
  • 1
  • 24
  • 22
  • I forgot to mention some weirdness about these options. I remember deactivating boxes (by setting the border width to 0) and it worked but only using Acrobat Reader (any OS). The boxes were still visible when using xpdf or evince as I usually do. – Lohrun May 06 '10 at 08:31
  • 2
    Lohrun, Thanks! However, I found that the color format should be RGB: so it should be \hypersetup{ citebordercolor=.1 .1 1, linkbordercolor=0 0 1, urlbordercolor=.9 .1 0, } Thanks though! Thomas – Thomas May 09 '10 at 20:57
  • 1
    Actually, color names work just fine. Also, please consider accepting the answer as correct if it worked. – recluze Nov 16 '11 at 05:44
  • 6
    info: capitalized `urlcolor=Blue` did *not* work for me in usepackage option call. `urlcolor=blue` did work. – K.-Michael Aye Nov 26 '12 at 07:53
  • 2
    Link to hyperref manual not working anymore. Also I'm getting errors with Blue, blue, or even 0 0 1, or .1 . 1 .1 or .9 .1 0, or Red or red or Violet or violet. – Nike May 23 '18 at 03:42
  • 1
    these settings aren't working, link to documentation is broken – baxx Nov 17 '18 at 20:12