Latest news 2020-07-03: SmashWords sale (ends 31st July 2020): 50% off crime/SF novel The Private Enemy and 100% off (free!) I’ve Heard the Mermaid Sing.

Bug Tracker

ID: 74 🔗 Closed (Not a Bug) glossaries 4.11 2014-11-19 12:37:58 Incorrect acronym expansion

Report

In the attached MWE, acronym acr2 uses \gls{acr1} in the long form. On first use in the text, \gls{acr2} is expanded with "(acr1)" appended instead of "(acr2)". If I omit \setacronymstyle{long-short} from the preamble, the expected short form is used.

This is with glossaries 2014/09/01 v4.11 (NLCT), xelatex and makeglossaries.

MWE

\documentclass{article}

\usepackage[acronym]{glossaries}
\setacronymstyle{long-short}

\makeglossaries

\newacronym{acr1}{acr1}{first acronym}
\newacronym{acr2}{acr2}{another version of \gls{acr1}}

\begin{document}

\printglossaries

In my text, I first use \gls{acr1} and \gls{acr2} for the first time, then I
use both \gls{acr1} and \gls{acr2} a second time.

\end{document}


Evaluation

This occurs because the first use of acr1 occurs in the list of acronyms, which is at the start of the document. The same thing happens if an acronym occurs in the table of contents. Suggestions:
• use \acrfull{acr1} or \acrshort{acr1} or \acrlong{acr1} instead of \gls{acr1} in the definition, or:
• reset the acronyms after the glossary:
\printglossaries
\glsresetall

Closed as this is expected behaviour not a bug.

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.)