[Tex/LaTex] Do not display one special acronym in list of acronyms

acronymsglossaries

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}

Best Answer

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}