开发者

LaTeX changes colour of in-text citing with hyperref package and natbib

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_fina开发者_运维百科l}
 \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.


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜