# Glossary terms appear in full in the list of figures

I am using the command gls to create a glossary at the beginning of my thesis. However if I use the command for example in the caption of a figure environment, then the only time the full text together with its acronym appears only in the list of figures.

This then entails that the first time I use gls for a term in the main body of the thesis, only the acronym appears in the compiled version....

Is there a way to get around this issue??

• Possibly related to How not to expand acronym in toc or section title. You can use \glsresetall after \listoffigures but beware of nested hyperlinks if you use hyperref. – Nicola Talbot Mar 25 '15 at 11:39
• – Nicola Talbot Mar 25 '15 at 13:20
• While I have no reason to think it will take care of glossaries, the notoccite package fixes similar problems when using \cites inside of figure captions. You might try it just to see. – Steven B. Segletes Apr 24 '15 at 10:50

I've found this to be the quickest solution for me:

\begin{document}
[...]
\glsunsetall
\listoffigures
\listoftables
\glsresetall
[...]
\end{document}


The commands \glsunsetall and \glsresetall have the function to set or reset the so-called first use flag. With the sequence I've written, acronyms in the LoF and LoT are in the short form. Then, thanks to \glsresetall, they are displayed correctly in the text (first use first, and then the short form).

assuming you have something like this:

\newacronym{ex}{EX}{Example X}


You can use \caption[ex]{\gls{ex}}. This way, the actual caption shown in List of Figures doesn't invoke glossaries.

In addition to the suggestion in the other answer, you can use \glsentryshort instead of \gls in the caption:

\caption{An example \glsentryshort{sample}}


Another option is to use the extension package glossaries-extra which provides commands like \glsfmtshort which are designed to work in captions and section headings. This has the advantage over \glsentryshort in that it includes the font change for styles that set the abbreviation in a particular font. For example:

\documentclass{report}

\usepackage[T1]{fontenc}
\usepackage{glossaries-extra}

\makeglossaries

\setabbreviationstyle[acronym]{long-short-sc}
\newacronym{sample}{short-form}{long-form}

\begin{document}
\listoffigures

\chapter{Sample}
First use: \gls{sample}.

Next use: \gls{sample}.

\begin{figure}
\centering
Insert figure here.
\caption{An example \glsfmtshort{sample}}
\end{figure}

\printglossaries

\end{document}


If you prefer the long form, you can use \glsfmtlong instead, or the full form with \glsfmtfull.