当我使用命令调用缩写时\gls{}
,文档中的缩写颜色是我定义的自定义颜色(蓝灰色)。我只在引用图表而不是缩写时才想要这种颜色。
\definecolor{bluegray}{rgb}{0.4, 0.6, 0.8}
\definecolor{black}{rgb}{0.0, 0.0, 0.0}
\definecolor{bluee}{rgb}{0.0, 0.47, 0.75}
\AtBeginDocument{%
\hypersetup{
citecolor=black,
linkcolor=bluegray,
urlcolor=black,
linktoc=all}}
答案1
您必须重新定义该命令\glstextformat
。
梅威瑟:
\documentclass{article}
\usepackage{lipsum, etoolbox, xcolor, graphicx}
\usepackage{hyperref}
\usepackage[acronym]{glossaries}
\hypersetup{%
colorlinks=true,
linkcolor=bluegray,
citecolor=black,
urlcolor=black,
linktoc=all,
}
\renewcommand*{\glstextformat}[1]{\textcolor{black}{#1}}
\definecolor{bluegray}{rgb}{0.4, 0.6, 0.8}
\definecolor{black}{rgb}{0.0, 0.0, 0.0}
\definecolor{bluee}{rgb}{0.0, 0.47, 0.75}
\makeglossaries%
\newacronym{gcd}{GCD}{Greatest Common Divisor}
\newacronym{lcm}{LCM}{Least Common Multiple}
\begin{document}
\printglossaries%
\listoffigures
\vspace{1cm}
\lipsum[2]
\begin{figure}[!htbp]
\centering
\includegraphics[width=.5\textwidth]{example-image-a}
\caption{sample image}%
\label{fig:sample}
\end{figure}
\lipsum[2]
See figure~\ref{fig:sample} or \gls{gcd}.
\end{document}