Latest news 2019-11-04: The giveaway of two signed copies of “Quack, quack, quack. Give my hat back!” has closed and the winning entrants have been selected. Thank you to everyone who took part.

glossaries package FAQ

FAQ Search Tips

How do I change the way the text appears when I use commands like \gls for a given glossary? 🔗

As from version 4.0, you can use \defglsentryfmt (see How do I change the way the text appears when I use commands like \gls?) to change the way glossary entries appear when using commands like \gls or \glsdisp. See the section Changing the format of the link text in the user manual for further information.

Versions prior to v4.0

If you have multiple glossaries, changing \glsdisplayfirst and \glsdisplay (see How do I change the way the text appears when I use commands like \gls?) will change the way all glossary entries appear when using commands like \gls. If you only want the change to affect entries for a given glossary, then you need to use \defglsdisplay and \defglsdisplayfirst instead of redefining \glsdisplay and \glsdisplayfirst.

Both \defglsdisplay and \defglsdisplayfirst take two arguments: the first is the glossary name and the second is how the term should be displayed when it is invoked using commands like \gls and \glspl. This is similar to the way \glsdisplayfirst was redefined in the previous section except that you must use ##1, ##2, ##3 and ##4 instead of #1, #2, #3 and #4.

For example, suppose you have created a new glossary called notation and you want to change the way the entry is displayed on first use so that it includes the symbol, you can do:

\defglsdisplayfirst{notation}{##1##4 (denoted ##3)}
Now suppose you have defined an entry as follows:
\newglossaryentry{set}{type=notation,
name=set,
description={A collection of objects},
symbol={$S$},
}
The first time you reference this entry using \gls it will be displayed as: "set (denoted S)" (similarly for \glspl and the other variants).

Last modified: 2013-12-14 09:58:35.


Category: glossaries package
Topic: Referencing Terms

© 2019 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs