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

Bug Tracker RSS feed

I’m currently working on a major new version of the datatool package. This may take a while. Please be patient. (Experimental version available for testing.)

ID 261🔗
Submitted by: Kelli
Date: 2023-06-26 14:03:21
Last update: 2023-06-26 14:14:58
Status Open
Sign in if you want to bump this report.
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}

Comments

0 comments.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=261