2

In the glossary chapter, I want to change the page number color from black to blue. How to do that ? Is there an option in the \usepackage{glossaries} entry ?

\usepackage{glossaries}
\renewcommand*{\glstextformat}[1]{\textcolor{blue}{#1}} 
\newglossaryentry{IaaS}{name=IaaS,description={Infrastructure as a Service}}
1
  • Welcome to TeX.sx! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Aug 20, 2013 at 14:28

1 Answer 1

3

The simplest way is to redefined \glossaryentrynumbers to typeset its argument in your required colour:

\renewcommand{\glossaryentrynumbers}[1]{\textcolor{blue}{#1}}

However, this will also change the colour of the number and range separators. If you don't want that to happen you'll need to redefine them:

\renewcommand{\delimN}{\textcolor{black}{, }}
\renewcommand{\delimR}{\textcolor{black}{--}}

Here's a minimal example:

\documentclass{article}

\usepackage{xcolor}
\usepackage{glossaries}

\makeglossaries

\newglossaryentry{IaaS}{name=IaaS,description={Infrastructure as a
Service}}

\renewcommand{\glossaryentrynumbers}[1]{\textcolor{blue}{#1}}
\renewcommand{\delimN}{\textcolor{black}{, }}
\renewcommand{\delimR}{\textcolor{black}{--}}

\begin{document}

\gls{IaaS}

\newpage

\gls{IaaS}

\newpage

\printglossaries

\end{document}

The glossary looks like:

Image of typeset glossary

Note: This won't work if you are using hyperref as the link colour will override the current text colour.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy