5

How can I set \gls glossaries entries as bold, but not \glsdesc definitions?

% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex

\documentclass{article}

\usepackage[colorlinks=true]{hyperref}
\usepackage[acronym,toc,style=listgroup]{glossaries}
\makeglossaries

\newglossaryentry{apc} {
    name = {antigen presenting cell},
    description = {cells that present MHC proteins on their surface},
}

% glossary definitions as bold
\renewcommand*{\glstextformat}[1]{\textcolor{black}{\textbf{#1}}}


\begin{document}

\Glspl{apc} are \glsdesc*{apc}.

\printglossary

\end{document}

(Please note this is related, but not identical, to such question as How to show glossary entry name in bold when using long style?)

1 Answer 1

5

Add this line in your preamble:

\defglsentryfmt{\color{black}\bfseries\glsgenentryfmt}

and delete

\renewcommand*{\glstextformat}[1]{\textcolor{black}{\textbf{#1}}}

MWE:

% arara: pdflatex
% arara: makeglossaries
% arara: pdflatex

\documentclass{article}

\usepackage[colorlinks=true]{hyperref}
\usepackage[acronym,toc,style=listgroup]{glossaries}
\makeglossaries

\newglossaryentry{apc} {
    name = {antigen presenting cell},
    description = {cells that present MHC proteins on their surface},
}

% glossary definitions as bold
\defglsentryfmt{\color{black}\bfseries\glsgenentryfmt}

\begin{document}

\Glspl{apc} are \glsdesc*{apc}.

\printglossary

\end{document} 

Output:

enter image description here

5
  • Perfect! I thought there would be no such direct approach to this one, thanks! Commented Jan 5, 2015 at 3:56
  • 1
    @RicardoCruz You're welcome Commented Jan 5, 2015 at 5:56
  • oh I just noticed this won't work for acronymous -- do you know if there is a solution for those? Commented Jan 5, 2015 at 21:56
  • 1
    @RicardoCruz Try adding \defglsentryfmt[acronym]{\color{black}\bfseries\glsgenentryfmt} Commented Jan 6, 2015 at 6:08
  • 1
    @RicardoCruz Happy about that! Commented Jan 7, 2015 at 18:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .