Bug Tracker

ID: 163 🔗 Closed (Not a Bug) glossaries 4.43 2020-06-23 09:21:26 Inverted crossref (see and seealso) behavior

Report

It seems cross-references (i.e. "see" and "seealso" attributes of glossaryentries) are inverted (relative behavior of \gls) when building the glossary. Example: These glossary entries exist and are referencing each other in the following way:
• text-body -> \gls -> item2
• item2 -> "see" -> item1see
• item2 -> "seealso" -> item1seealso
• item2 -> \gls -> item1gls
• item3see -> "see" -> item2
• item3seealso -> "seealso" -> item2
Output in glossary:
• item1gls
• item2
• item3see
• item3seealso
Expected output in glossary:
• item1gls
• item1see
• item1seealso
• item2
See fuller description at [TeX.SX Link]

MWE

\documentclass[a4paper]{article}

\usepackage[automake]{glossaries-extra}

\makeglossaries{}

\newglossaryentry{item1see}
{
name=item1see,
description={Item 1 see}
}
\newglossaryentry{item1seealso}
{
name=item1seealso,
description={Item 1 seealso}
}
\newglossaryentry{item1gls}
{
name=item1gls,
description={Item 1 gls}
}
\newglossaryentry{item2}
{
name=item2,
description={Item2 2, not like \gls{item1gls} at all.},
see={item1see},
seealso={item1seealso}
}
\newglossaryentry{item3see}
{
name=item3see,
description={Item 3 see},
see={item2}
}
\newglossaryentry{item3seealso}
{
name=item3seealso,
description={Item 3 seealso},
seealso={item2}
}

\begin{document}
I reference \gls{item2}, but none of the others directly in the text.

\printglossaries

\end{document}


Evaluation

This is the documented behaviour of the see and seealso keys. The description of the see key in chapter 4 of the glossaries user manual starts as follows (emphasis in the original):
see Cross-reference another entry. Using the see key will automatically add this entry to the glossary, but will not automatically add the cross-referenced entry.
As mentioned in the glossaries manual, the see key essentially provides a convenient shortcut that performs
\glssee[tag]{label}{xr-label list}

after the entry has been defined. It's this command that performs the indexing.

If you want to avoid this automatic indexing, consider using bib2gls instead, which provides much better handling of these cross-references.

Watch This Report

If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

Name: (Optional.)