我使用该acronyms
包来定义如下数学符号:
\begin{acronym}[long]
\acro{v}[$\vec{v}$]{View direction vector}
\end{acronym}
我和许多其他人一样这样做,因为打字速度\acs{<short>}
比长数学模式表达式更快。
当我使用这个时,hyperref
包会将输出格式化为特定颜色。我喜欢这样,比如 GPS 这样的缩写词,因为我希望读者看到简短版本是可点击的。对于这些缩写词,我使用与上面类似的其他缩写词列表。
但我不希望数学表达式在方程式中被着色,因为如果一些被定义为首字母缩略词而其他的则手动书写,会影响可读性。
我现在的问题是: 我可以让 hyperref 从特定的首字母缩略词列表中删除链接的颜色吗?或者我可以关闭数学模式的链接着色吗?
这是我在这里的第一个问题,我希望我已经把我的问题说清楚了:-)
添加的示例:(我使用 classicthesis 和 arsclassica,它们使链接变成彩色,但颜色的来源并不重要)
\documentclass{scrreprt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% REQUIRED FOR ARSCLASSICA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{subfig}
\usepackage[strict]{changepage}
\usepackage[parts,dottedtoc,eulerchapternumbers,subfig,beramono,pdfspacing] {classicthesis}
\usepackage{arsclassica}
% hyperref and acronym
\usepackage{hyperref}
\usepackage{acronym}
\begin{document}
\chapter{Text}
Some text where I want to have \ac{BRDF} as a visibly colored link and in
an equation would not want the symbol to be a colored link.
\begin{equation}
\acs{fBRDF} = \dots
\end{equation}
However it would be nice if it still was a link. It just should not have
any color.
% Two acronym lists
\chapter{List of Abbreviations}
\begin{acronym}[GPS]
\acro{BRDF}{Bidirectional Reflectance Distribution Function}
\acro{RGB}{Red, Green, Blue}
\end{acronym}
\chapter{List of Symbols}
\begin{acronym}[$f(\vec{l},\vec{v})$]
\acro{fBRDF}[$f(\vec{l},\vec{v})$]{\acf{BRDF}}
\end{acronym}
\end{document}
答案1
可以将环境内的链接颜色临时设置为其他值(之前指定的值除外),然后将其恢复为原始值。
我使用该xpatch
包在环境启动后附加颜色变化代码equation
(宏\equation
),然后切换回来\endequation
(有效\end{equation}
)。
为了更好的方便,我定义了命令\DefaultDocumentLinkColor
并\DefaultDocumentEquationLinkColor
保存了颜色名称。
但是,使用普通文本颜色无法识别方程式链接。
\documentclass{scrreprt}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% REQUIRED FOR ARSCLASSICA
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{subfig}
\usepackage[strict]{changepage}
\usepackage[parts,dottedtoc,eulerchapternumbers,subfig,beramono,pdfspacing]{classicthesis}
\usepackage{arsclassica}
% hyperref and acronym
\usepackage{xpatch}
\newcommand{\DocumentDefaultLinkColor}{blue}
\newcommand{\DocumentDefaultEquationLinkColor}{black}
\usepackage{hyperref}
\usepackage{acronym}
\hypersetup{linkcolor={\DocumentDefaultLinkColor}}
\xapptocmd{\equation}{\hypersetup{linkcolor={\DocumentDefaultEquationLinkColor}}}{}{}%
\xapptocmd{\endequation}{\hypersetup{linkcolor={\DocumentDefaultLinkColor}}}{}{}%
\begin{document}
\chapter{Text}
Some text where I want to have \ac{BRDF} as a visibly colored link and in
an equation would not want the symbol to be a colored link. See \ref{listofsymbols}
\begin{equation}
\acs{fBRDF} = \dots
\end{equation}
However it would be nice if it still was a link. It just should not have
any color.
% Two acronym lists
\chapter{List of Abbreviations}
\begin{acronym}[GPS]
\acro{BRDF}{Bidirectional Reflectance Distribution Function}
\acro{RGB}{Red, Green, Blue}
\end{acronym}
\chapter{List of Symbols} \label{listofsymbols}
\begin{acronym}[$f(\vec{l},\vec{v})$]
\acro{fBRDF}[$f(\vec{l},\vec{v})$]{\acf{BRDF}}
\end{acronym}
\end{document}