Bug Tracker 
ID | 274🔗 |
---|---|
Submitted by: | Denis Bitouzé |
Date: | 2024-05-23 13:44:55 |
Last update: | 2025-03-16 15:15:56 |
Status | Closed (Not a Bug) |
Category | glossaries |
Version | 4.54 |
Summary | Wrong short form produced by the first occurrence of \gls for an acronym containing a nested acronym |
Sign in to subscribe to notifications about this report.
Description
For an acronym containing a nested acronym, the short form of the full form produced by the first occurrence of\gls{⟨label⟩}
is wrong. More precisely, with:
\newacronym{lid} {LID} {lorem ipsum dolor} \newacronym{lidsa}{LIDSA}{\acrshort{lid} sit amet}the first occurrence of
\gls{lidsa}
should display:
LID sit amet (LIDSA)but it displays (note the missing “SA”):
LID sit amet (LID)The short forms displayed by the subsequent occurrences of
\gls{lidsa}
are okay.As a workaround, one could put the nested acronym between curly braces:
\newacronym{lidsa}{LIDSA}{{\acrshort{lid}} sit amet}But I guess there's something wrong here.
MWE
Download (1.27K)
\listfiles \documentclass{standalone} \usepackage{glossaries} \makeglossaries \newacronym{lid} {LID} {lorem ipsum dolor} \newacronym{lidsa} {LIDSA} { \acrshort{lid} sit amet} \newacronym{lidsabis}{LIDSABIS}{{\acrshort{lid}} sit amet} % ^ ^ \begin{document} \begin{tabular}{@{}llll} Definition of the acronym (\verb|\newacronym{label}{short}{long}|) & Comment & Command & Result \\\hline \verb|\newacronym{lid} {LID} {lorem ipsum dolor}| & Acronym & \verb|\gls{lid}| & \gls{lid} \\ \verb|\newacronym{lidsa} {LIDSA} { \acrshort{lid} sit amet}| & Nested acronym without braces & \verb|\gls{lidsa}| & \gls{lidsa} \\ \verb| ^ ^| & & \verb|\gls{lidsa}| & \gls{lidsa} \\ \verb|\newacronym{lidsabis}{LIDSABIS}{{\acrshort{lid}} sit amet}| & Nested acronym with\phantom{out} braces & \verb|\gls{lidsabis}| & \gls{lidsabis} \\ \verb| ^ ^| & & \verb|\gls{lidsabis}| & \gls{lidsabis} \\ \end{tabular} \end{document}
Evaluation
The glossaries manual does say "Avoid nested definitions" in a red box in section 6. If you must use them then grouping is the only way to avoid the problem with just the base glossaries package. There's more information in 5.4. "Nested Links" of the glossaries-extra manual, which provides extra workarounds.
Comments
2 comments.
Replying to Comment #140:
🔗Comment from Nicola Talbot 🦜
Date: 2024-05-23 19:14:31
Repying to: Denis Bitouzé 2024-05-23 19:06:27
Date: 2024-05-23 19:14:31
Repying to: Denis Bitouzé 2024-05-23 19:06:27
I think I need to move the note to a more prominent location in the manual. I'm sorry I can't link to the relevant sections at the moment as CTAN seems to be down.
Replying to Comment #141:
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=274
Date: 2024-05-23 19:06:27
OK, I missed that. Thanks.