5

I am using glossaries to keep track of my acronyms and a few other lists. However, I am running into a situation where I want to use \acf to print the full acronym, and the description should not be repeated by subsequent \ac commands. By default, if one uses \acf first, the first occurrence of \ac will again print the entire acronym such as Test Acronym (TA).

In specific, I am making a description list to introduce a few terms, and want to make sure the full acronym is in the label:

\documentclass{scrreprt}

\usepackage[xindy, shortcuts]{glossaries}

\newacronym{TA}{TA}{Test Acronym}
    \makeglossaries

\begin{document}

\printglossary[type=\acronymtype]

\begin{description}
    \item[\acf{TA}] This is an explanation of the item…
         The first use flag should be set after this!
         But it does!, and will display Test Acronym (TA) again… Which is not intended!
\end{description}

When using \ac{TA} here like this, it should not reproduce the entire entry again.

\printglossary

\end{document}

Thus, how can I set/enforce the first use flag manually, or circumvent this problem here?

2
  • Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Marco Daniel May 20 '13 at 13:40
  • My bad. I was assuming this was obvious to someone, and he could just post a single command that would take care of this and which I just missed in the documentation :). – Ingo May 20 '13 at 13:49
5

The package glossaries defines a boolean flag for every entry. If you call \ac the boolean flag is set to true. That means next time you know that the entry was used.

To set this flag manual the package provides the command \glsunset.

The documentation describes the command at page 105 (glossaries-user.pdf).

When using \gls, \glspl and their uppercase variants it is possible that you may want to use the value given by the first key, even though you have already used the glossary entry. Conversely, you may want to use the value given by the text key, even though you haven’t used the glossary entry. The former can be achieved by one of the following commands:

...

while the latter can be achieved by one of the following commands:

\glsunset{⟨label⟩}

Related to your example do:

\documentclass{scrreprt}

\usepackage[xindy, shortcuts]{glossaries}

\newacronym{TA}{TA}{Test Acronym}
    \makeglossaries

\begin{document}

\printglossary[type=\acronymtype]

\begin{description}
    \item[\acf{TA}\glsunset{TA}] This is an explanation of the item…
         The first use flag should be set after this!
         But it does!, and will display Test Acronym (TA) again… Which is not intended!
\end{description}

When using \ac{TA} here like this, it should not reproduce the entire entry again.

\printglossary

\end{document}

enter image description here

1
  • 3
    Thanks. This was very unintuitive for me, because I would not expect the command \glsUNset to SET the first use flag. I was just not looking for the right thing. Thanks for the help. – Ingo May 21 '13 at 12:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.