Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

glossaries package FAQ

A spurious comma appears in the number list 🔗

This usually occurs because there’s a location in the list with a format (such as glsignore or, with glossaries-extra, glsxtrunusedformat) that doesn’t display anything. From makeindex and xindy’s point of view, this is just another formatted location.

The glsignore format is used by \glsaddallunused which iterates over all entries and, for any entry that is marked as unused, it will do \gls[format=glsignore]{label}. This ensures that the entry is indexed (and therefore is listed in the glossary) but the page number is typically not wanted. If this is the only time the given entry is indexed, then it will have a location list that consists of a single, invisible location.

The spurious comma in the location list is usually the result of placing \glsaddallunused too early or after a reset (e.g. \glsresetall) or when an entry has only been used by commands that don’t unset the first use flag. If your document contains \glsaddallunused:

Note that bib2gls recognises glsignore as indicating an “ignored location”. This means the entry will be selected but that location will be discarded, which avoids this problem. (However, you can’t use \glsaddallunused with bib2gls. Use the selection=all resource option instead.) For example, at the start of your back matter, you can do (with glossaries-extra):

\GlsXtrSetDefaultNumberFormat{glsignore}

This will ensure that any entries in the back matter are selected by bib2gls but their locations won’t be added to the location lists. This approach can’t be used with makeindex or xindy as it will result in the location list including invisible locations separated by visible commas or dashes.

2020-07-02 12:25:11


Permalink: https://www.dickimaw-books.com/faq.php?id=243
Alternative link: https://www.dickimaw-books.com/faq.php?itemlabel=invisiblelocations

Category: glossaries package
Topic: Unexpected Output in the Glossaries