4

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

4

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

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

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.