LaTeX 使用 hyperref 包和 natbib 更改文本引用的颜色
我正在使用 natbib 和 hyperref 包在我的 LaTeX 文档中,并且希望将超引用引文周围的框颜色从基线绿色更改为更柔和的颜色(紫罗兰色或海军蓝色) )。但是,在使用建议的代码来执行此操作时,我无法更改引用链接的颜色。 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}
但是,当我编译时(我编译了多次以确保),我的 pdf 文件看起来与我排除了 \hypersetup
中的格式一样(仍然是相同的绿色)。我还想把脚注引文也加起来。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,您提供的示例代码使用选项
colorlinks=false
停用链接着色。您应该使用以下 hyperref 设置命令来实际更改链接颜色。要更改链接和引文周围的框颜色,您还有以下其他选项:
框外观(特别是 PDF 链接边框的宽度)由
pdfborder
选项控制。如果设置了colorlinks
选项,则禁用框(请参阅hyperref 手册 了解更多信息)。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.To change box color around the links and citations, you have these other options :
Box appearance (specifically, width of PDF link border) is controlled by the
pdfborder
option. If thecolorlinks
option is set, boxes are deactivated (see the hyperref manual for more information).