LaTeX 使用 hyperref 包和 natbib 更改文本引用的颜色

发布于 2024-08-31 11:46:24 字数 666 浏览 3 评论 0原文

我正在使用 natbibhyperref 包在我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪漫之都 2024-09-07 11:46:24

实际上,您提供的示例代码使用选项 colorlinks=false 停用链接着色。您应该使用以下 hyperref 设置命令来实际更改链接颜色。

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

要更改链接和引文周围的框颜色,您还有以下其他选项:

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

框外观(特别是 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.

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文