3

I have defined a lot of terms with the glossaries package and use them in my text with the \gls{} command. However, I'd like terms called with \gls{} to appear bold, so people know that it is a term defined in the glossary. What command do I have to renew and how to achieve this?

Thanks in advance,

2 Answers 2

7

The glossaries package offers the command \glstextformat to control the way the text is displayed, so you can write

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

or

\renewcommand*{\glstextformat}{\textbf}

in the preamble of your document.

2
  • I should have mentioned, I am using the glossaries package, didn't know that there was a previous version. Commented Jun 19, 2011 at 16:37
  • or even \renewcommand*{\glstextformat}{\textbf} which is even preferable, albeit a little hard to digest for beginners.
    – egreg
    Commented Jun 19, 2011 at 16:37
0

I don't know whether \gls is your command or an external one, to whose definition you don't have easy access. If the latter, then you can do something like

\let\oldgls=\gls
\renewcommand\gls[1]{\textbf{\oldgls{#1}}}

(This sort of manipulation can be automated using patch.) If the former, then, rather than devoting a new command to it, you can just replace your definition

\newcommand\gls[1]{...}

by

\newcommand\gls[1]{\textbf{...}}
1
  • Oops, sorry, I missed the fact that you were using a specific package. My answer is about general fiddling with commands after their definition; G Medina's answer (tex.stackexchange.com/questions/21152/…) is a much better approach in your specific setting.
    – LSpice
    Commented Jun 19, 2011 at 17:41

You must log in to answer this question.

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