Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LaTeX中hyperref对目录和参考文献超链接以及颜色的设定 #863

Closed
louieworth opened this issue Apr 14, 2023 · 4 comments
Closed

Comments

@louieworth
Copy link

编译环境

follow link 意图修改参考文献颜色,正文无变化。

描述问题

《研究生学位论文写作指南》第 xx 页要求……而模板编译的结果是……

截图:

image

复现上述问题的代码:

\usepackage[colorlinks,
            linkcolor=blue,       %%修改此处为你想要的颜色
            anchorcolor=blue,  %%修改此处为你想要的颜色
            citecolor=blue,        %%修改此处为你想要的颜色,例如修改blue为red
            ]{hyperref}
\usepackage{cleveref}
\usepackage{comment}
\usepackage{wrapfig}
@Harry-Chen
Copy link
Member

模板中已经先期引入和配置了 hyperref,再次加载是无效的。可以使用 \hypersetup 来修改

@louieworth
Copy link
Author

看起来比较困难,有instruction如何去修改所有的\ref{}为蓝色吗?

@zepinglee
Copy link
Contributor

\usepackage{hyperref}
\hypersetup{
  colorlinks,
  linkcolor=blue,       %%修改此处为你想要的颜色
  anchorcolor=blue,  %%修改此处为你想要的颜色
  citecolor=blue,        %%修改此处为你想要的颜色,例如修改blue为red
}

目前模板是在载入 hyperref 后进行设置的,所以在 \usepackage 处的选项无效。

thuthesis/thuthesis.dtx

Lines 6355 to 6369 in 705f1da

\AtEndOfPackageFile*{hyperref}{
\hypersetup{
linktoc = all,
bookmarksdepth = 2,
bookmarksnumbered = true,
bookmarksopen = true,
bookmarksopenlevel = 1,
bookmarksdepth = 3,
unicode = true,
psdextra = true,
breaklinks = true,
plainpages = false,
pdfdisplaydoctitle = true,
hidelinks,
}%

我觉得可以改成使用 \PassOptionsToPackage 进行配置,这样可以被用户传递的选项覆盖。

@zepinglee
Copy link
Contributor

另外提醒一下,如果黑白打印,蓝色会变成灰色。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants