我想使用hyperref包只对引用进行着色,但似乎它对每个链接都进行了着色。
例如,在这里:
\documentclass{article}
\usepackage{hyperref}
\hypersetup{
citecolor = blue,
colorlinks = true,
}
\begin{document}
\tableofcontents
\section{This title should be in red in the TOC}
This citation \cite{a} is blue.
\begin{thebibliography}{99}
\bibitem{a} Andros, Using hyperref for a citation, StackExchange, 2022.
\end{thebibliography}
\end{document} 我希望引文是蓝色的,但我不希望目录中的项目是红色的。
谢谢
发布于 2022-03-17 11:39:08
我不会用光束激活colorlinks。这可以打破精心设计的色彩主题,有时非常令人惊讶的地方。
相反,您可以更改引文的文本颜色:
\documentclass{beamer}
\usetheme{metropolis}
\usepackage{xpatch}
\usepackage{xspace}
\makeatletter
\xpretocmd{\@citex}{\color{blue}}{}{}
\xapptocmd{\@citex}{\color{normal text.fg}\xspace}{}{}
\makeatother
\begin{document}
\begin{frame}
This citation \cite{a} is blue.
\begin{thebibliography}{99}
\bibitem{a} Andros, Using hyperref for a citation, StackExchange, 2022.
\end{thebibliography}
\end{frame}
\end{document} https://stackoverflow.com/questions/71510620
复制相似问题