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
.
\glsresetall
after\listoffigures
but beware of nested hyperlinks if you usehyperref
.notoccite
package fixes similar problems when using\cite
s inside of figure captions. You might try it just to see.