Bug Tracker 
ID | 261🔗 |
---|---|
Submitted by: | Kelli |
Date: | 2023-06-26 14:03:21 |
Last update: | 2025-03-16 15:11:04 |
Status | Closed (Not a Bug) |
Category | glossaries |
Version | 4.5.2 |
Summary | Nested acronym must be defined before acronym that calls it |
Sign in to subscribe to notifications about this report.
Description
If I have a nested acronym, e.g.,\newacronym{child}{child}{example \glsentrylong{parent}}but it only works if the acronym that is being nested is defined before the one that uses it. If it is not, the resulting pdf has a blank space instead of the text that should be there. For my previous example the resulting text looks like ``example (child)'' instead of ``example TEXT FROM nested (child)''.
I typically use an external file to define all of my acronyms where the individual entries are in alphabetic order. Thus, some of my nested entries work and some do not because I am not ensuring that all entries with a nested object in their long entry come after the entry that they are calling. I tried compiling multiple times but that did not fix the problem. It would be great if the acronyms could be defined in any order. I understand that this might not be possible though, and if so, I am sorry for asking for something that I can clearly fix by just ensuring that my ordering is appropriate. Thank you for the glossaries package, it has been a great help for our extremely long documents.
MWE
Download (314B)
\documentclass{article} \usepackage{glossaries} \newacronym{child1}{Child 1}{Child 1} \newacronym{adult1}{Adult 1}{Adult 1 \glsentrylong{child1}} \newacronym{adult2}{Adult 2}{Adult 2 \glsentrylong{child2}} \newacronym{child2}{Child 2}{Child 2} \begin{document} \Gls{adult1} \Gls{adult2} \end{document}
Evaluation
This is occurring because field expansion is on by default for the long
field. You can solve it by switching off expansion before you define your entries:
\documentclass{article} \usepackage{glossaries} \glsnoexpandfields \newacronym{child1}{Child 1}{Child 1} \newacronym{adult1}{Adult 1}{Adult 1 \glsentrylong{child1}} \newacronym{adult2}{Adult 2}{Adult 2 \glsentrylong{child2}} \newacronym{child2}{Child 2}{Child 2} \begin{document} \Gls{adult1} \Gls{adult2} \end{document}
I will have to close this as not a bug as the \glsentry...
set of commands can't be used before the referenced entry has been defined because the internal commands are not yet defined, and since they are defined to be expandable there are no checks to trigger an error if they are not defined.
Comments
0 comments.
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=261