
我使用該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}