# How to print all the acronyms?

In my figures I used some acronyms (i.e. embedded in the figures, not readable by LaTeX). I included all the acronyms in a file. LaTeX only printed the acronyms appeared in the text, and ignored other acronyms I included. How to make LaTeX print all the acronyms? Thanks!

Update: In addition, I don't want the pages where the acronyms appear to be shown. Because LaTeX could not read the acronyms in the figures, for those figure-embedded acronyms, there would be no page displayed next to them. It would appear inconsistent: some acronyms with pages next to them and some without. Therefore, I don't want the pages where the acronyms appear to be shown.

• Use \glsaddall – user31729 Apr 27 '17 at 19:18
• Use nonumberlist option to prevent the page list from showing or use \glsadd{label} next to \includegraphics for each acronym shown in the figure to include the page. – Nicola Talbot Apr 27 '17 at 19:22
• Thanks, both! I used \glsaddallunusedand \printglossary[type=\acronymtype, nonumberlist]. Update: At first I used \glsaddall, but it didn' work. I don't know why. But now it seems both \glsaddall and \glsaddallunused could work. – fyang Apr 27 '17 at 19:31
• I'm voting to close this question as off-topic because this question was solved in the comments. – TeXnician Apr 27 '17 at 19:47
• @NicolaTalbot Seems your comment comment solved the problem. Would you like to write an answer? – user36296 Apr 27 '17 at 20:20

There are various methods. First is to use nonumberlist (either as a package option or in \printglossary) in combination with \glsaddall (which must be used after all acronyms have been defined).

For example:

\documentclass{article}

\usepackage{graphics}
\usepackage[acronym,nonumberlist]{glossaries}

\makeglossaries

\newacronym{ac1}{ac1}{acronym 1}
\newacronym{ac2}{ac2}{acronym 1}

\begin{document}
\gls{ac1}.

\begin{figure}
\centering
\includegraphics{example-image}
\caption{A Figure}
\end{figure}

\printglossaries
\end{document}


This omits all page numbers and includes all entries.

The second method doesn't use nonumberlist or \glsaddall but instead uses \glsaddallunused. This command must go at the end of the document:

\documentclass{article}

\usepackage{graphics}
\usepackage[acronym]{glossaries}

\makeglossaries

\newacronym{ac1}{ac1}{acronym 1}
\newacronym{ac2}{ac2}{acronym 1}

\begin{document}
\gls{ac1}.

\begin{figure}
\centering
\includegraphics{example-image}
\caption{A Figure}
\end{figure}

\printglossaries

\end{document}


This displays the page list for ac1 which has been used in the document, but not for ac2.

For the third method, let's suppose ac2 is displayed in the image. Instead of using \glsaddallused, you can index ac2 next to the image. Like this:

\documentclass{article}

\usepackage{graphics}
\usepackage[acronym]{glossaries}

\makeglossaries

\newacronym{ac1}{ac1}{acronym 1}
\newacronym{ac2}{ac2}{acronym 1}

\begin{document}
\gls{ac1}.

\begin{figure}
\centering

This doesn't display any text next to the image, but it does index ac2, which means that ac2 now appears in the acronym list with the page number on which the image appears.