As from glossaries
v4.08, the command that performs the actual hyperlink is \glsdohyperlink
. The default definition is
\newcommand*{\glsdohyperlink}[2]{\hyperlink{#1}{#2}}
When the hyperlinks are enabled with \glsenablehyper
, the internal command that's used for the hyperlinks is set to \glsdohyperlink
. (In earlier versions, it was set directly to \hyperlink
.) This means that if you want to adjust the hyperlinks, you can redefine \glsdohyperlink
and then use \glsenablehyper
(rather than having to fiddle with internal commands.) For example:
% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex
% arara: bibtex
% arara: pdflatex
% arara: pdflatex
\documentclass{article}
\usepackage[colorlinks = true,
linkcolor = red,
urlcolor = green,
citecolor = blue,
anchorcolor = blue]{hyperref}
\usepackage{glossaries}
\makeglossaries
\newglossaryentry{sample}{name={sample},description={an
example~\cite{article-minimal}}}
\renewcommand*{\glsdohyperlink}[2]{%
{\hypersetup{linkcolor=black}\hyperlink{#1}{#2}}}
\glsenablehyper
\begin{document}
\section{Sample}
\label{sec:sample}
A \gls{sample} entry in section~\ref{sec:sample}.
\printglossaries
\bibliographystyle{plain}
\bibliography{xampl}
\end{document}
This will work for the other glossary entry commands, such as \glstext
or \glslink
, but not for the links in the location lists. The above produces:

So the citation link is in blue, the cross-references (including location cross-references) are in red and the glossary entry links are in black.
\gls{}
?