Latest news 2024-07-03: Ebook sale (1st – 31st July 2024): short story cybercrime fiction Unsocial Media free; short story cybercrime fiction Smile for the Camera free; short story noir crime fiction I’ve Heard the Mermaid Sing free; crime fiction novel The Private Enemy US$1.99; illustrated children’s story The Foolish Hedgehog US$0.99.

glossaries package FAQ

How do I change the page numbers to another type of number in the glossary page lists? 🔗

The location list shown after each entry in the glossary defaults to the list of page numbers where the entry was indexed in the document. The location counter determines those numbers. By default, the location counter is the page counter. You can change the default location counter with the counter package option. For example, to use the section counter instead:

You can also change it later in the document with \setupglossaries. For example:
This will change the location counter from that point onwards. Any indexing that has already occurred, won’t be affected.

It’s also possible to change the location counter for a specific instance using the counter option in the optional argument of commands like \gls. For example:


You can set the default counter for a specific glossary when you define the glossary. For example, the following will set the default location counter to the equation counter for all entries in this new glossary:


Obviously, if you use a counter such as equation, you need to take care if you try indexing an entry outside of the context of that counter. Such as in text mode where the counter is equation.

The glossaries-extra package additionally provides the package options: equations, which automatically switches the location counter to equation when in a numbered equation environment, and floats, which will automatically switch to the corresponding counter, such as figure or table, when indexing occurs in a float. (Bear in mind that the float counter is incremented by \caption so any indexing within a float before the caption will have an incorrect location if the corresponding float counter is used.)

With glossaries-extra, it’s also possible to redefine the hook \glslinkpresetkeys to set the counter according to some condition, such as for a particular value of the category field.

2023-07-08 13:56:08

Alternative link:

Category: glossaries package
Topic: Glossary Formatting