# Using glossaries (acronyms) with Beamer

I would like to use the glossaries package for acronyms in Beamer presentations. However, when using Beamer's overlay mechanisms, I run into trouble.

An acronym (used for the first time) on a slide with overlays will have its long form printed on the first overlay but then be shown in its short form on the following overlays of that slide. This looks wrong, as it changes text between overlays that was supposed to appear static for the entire slide (across overlays). So, I guess what I would like is for glossaries to print the long form of an acronym on its first occurrence, but for all consecutive overlays displaying that first occurrence.

I include a minimal example of what I mean:

\documentclass{beamer}

\usepackage[acronym]{glossaries}
\newacronym{AMA}{AMA}{a meaningless acronym}

\begin{document}

\begin{frame}
\begin{itemize}
\item<1-> The first occurrence of the acronym \gls{AMA}.
\item<1-> The second occurence of the acronym \gls{AMA}.
\item<2-> Something else.
\end{itemize}
\end{frame}

\end{document}


As you can see, the problem is that the first occurrence of the acronym gets printed in short on the second overlay. I guess it may be difficult to keep track of since the acronym (here) effectively has to be printed in "long-short-long-short" form across the two overlays.

Can this be done? And hopefully, how?

If you know it's definitely the first occurrence, you can explicitly use \glsfirst instead of \gls. Something like this:

\documentclass{beamer}

\usepackage[acronym]{glossaries}
\newacronym{AMA}{AMA}{a meaningless acronym}

\begin{document}

\begin{frame}
\begin{itemize}
\item<1-> The first occurrence of the acronym \glsfirst{AMA}.
\item<1-> The second occurrence of the acronym \glstext{AMA}.
\item<2-> Something else.
\end{itemize}
\end{frame}
\glsunset{AMA}

\end{document}


Edit: Here's another approach:

\documentclass{beamer}

\usepackage[acronym]{glossaries}
\newacronym{AMA}{AMA}{a meaningless acronym}

\begin{document}

\ifglsused{AMA}
{\newcommand{\doAMA}{\gls{AMA}}}
{\newcommand{\doAMA}{\glsfirst{AMA}\glsunset{AMA}}}

\begin{frame}
\begin{itemize}
\item<1-> The first occurrence of the acronym \doAMA.
\item<1-> The second occurrence of the acronym \gls{AMA}.
\item<2-> Something else.
\end{itemize}
\end{frame}

\end{document}

• A workable solution, indeed. But it takes most of the fun (my reason for using it) out of glossaries - keeping track of first occurrence. This way, I will have to keep track of occurrences myself and glossaries does nothing but hold the acronym definitions themselves :-( – Thomas Arildsen Nov 12 '12 at 12:46
• I don't know the inner workings of glossaries, but I guess you do ;-) Couldn't glossaries be tweaked to expand \gls into the appropriate (long/short) form of the acronym before Beamer takes the code and repeats it across multiple overlays? – Thomas Arildsen Nov 12 '12 at 12:58
• @ThomasArildsen Unfortunately I'm not so familiar with the inner workings of beamer. I had an idea about providing a localised unset in \gls but the item text gets scoped, so that doesn't help. I've added an alternative approach to my answer. – Nicola Talbot Nov 12 '12 at 13:08
• Well, the second approach seems to do the trick. Thanks! – Thomas Arildsen Nov 12 '12 at 20:04

I believe that \acrfull{AMA} is all that's needed now.

\documentclass{beamer}

\usepackage[acronym]{glossaries}
\newacronym{AMA}{AMA}{a meaningless acronym}

\makeglossaries

\begin{document}

\begin{frame}
\begin{itemize}
\item<1-> The first occurrence of the acronym \acrfull{AMA}.
\item<2-> The second occurence of the acronym \gls{AMA}.
\item<3-> Something else.
\end{itemize}
\end{frame}

\end{document}


Works for me and is on page 164 of the User Manual for glossaries.sty.

• – Thomas Arildsen Mar 10 '15 at 12:42
• @ThomasArildsen yes, this MWE solves the problem addressed in your question for the latest installation. By linking me back to the question are you telling me that this doesn't produce the desired result? If so, please describe what behaviour is produced. – Laua Jul 28 '15 at 12:29