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?)

Ricardo Cruz
  • 1,770
  • 1
  • 22
  • 34

1 Answers1

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

karlkoeller
  • 124,410