15

In my document I use several acronyms which I do not wish to be displayed in the list of acronyms. This solution using the acronym-package unfortunately doesn't work as it clashes with my use of the glossaries-package. The minimal example ist as follows:

\documentclass{article}

\usepackage[acronym,shortcuts]{glossaries}
\makeglossaries

\newacronym{ex1}{Example 1}{should be displayed in list of acronyms when used at least once}
\newacronym{ex2}{Example 2}{should never be displayed in list of acronyms}

\begin{document}
\printglossaries

I use \textbf{\acs{ex1}} and \textbf{\acs{ex2}}  in my text.

\end{document}
meep.meep
  • 16,905
  • for future reference, check https://tex.stackexchange.com/questions/149296/do-not-display-one-special-acronym-in-list-of-acronyms-without-using-glossaries if you wish not to use the glossaries package and obtain almost the same result. – Irene Apr 15 '20 at 20:47

1 Answers1

13

The following seems to work:

  • Define a second acronym list (say, "hidden") using the acronymlists package option;

  • Declare the name and the filename extensions for this new "glossary";

  • Add the optional argument type=hidden to \newacronyms that shouldn't be displayed;

  • Instead of \printglossaries, use \printglossary and specify the type (and do so for all glossaries/acronym lists except the "hidden" one).


\documentclass{article}

\usepackage[acronym,shortcuts,acronymlists={hidden}]{glossaries}
\newglossary[algh]{hidden}{acrh}{acnh}{Hidden Acronyms}
\makeglossaries

\newacronym{ex1}{Example 1}{should be displayed in list of acronyms when used at least once}
\newacronym[type=hidden]{ex2}{Example 2}{should never be displayed in list of acronyms}

\begin{document}
\printglossary[type=\acronymtype]

% \printglossary[type=hidden]% umcomment for testing purposes

I use \textbf{\ac{ex1}} and \textbf{\ac{ex2}}  in my text.

\end{document}
lockstep
  • 250,273
  • 6
    You don't actually need to define a new glossary type. You can define the entry as usual and use \glsmoveentry to move it to an undefined glossary. See Moving Entries to Another Glossary – Nicola Talbot Dec 10 '13 at 09:31
  • Extremely useful, Nicola. Perhaps this feature should have been easier to find? It is quite useful to use the package to make sure the way you write terms is consistent, even if it does not belong in a list of abbreviations. – user1603472 Feb 01 '17 at 14:44