# Show long form of a glossary entry multiple times

Normally, the glossaries-extra package displays the long form of an abbreviation only the first time.

I would like to set the number of times that the long form of abbreviations are shown, before it starts showing the short form.

For example:

\documentclass{article}
\usepackage{glossaries-extra}

\setabbreviationstyle{long-only-short-only}
\glssetcategoryattribute{shortperiod}{retainfirstuseperiod}{true}

\newabbreviation[category=shortperiod]{etc}{etc.}{etcetera}

\begin{document}
\gls{etc}. \gls{etc}. \gls{etc}. \gls{etc}.
\end{document}


Results in:

etcetera. etc. etc. etc.


However, I would like to set the number of times that the long form is displayed. E.g., if I set the long form to be shown three times, the output would be:

etcetera. etcetera. etcetera. etc.


I don't think you can easily do that. AFAIK you'd need to turn on counting and then check the counter in order to respond accordingly. There are alternative ways, though.

\glsreset{etc} will unset a flag corresponding to the first use. Hence, afterwards on the next issue of \gls{...}, you will get the "first form" or "full form" depending on your global settings. In glossary-extra, the equivalent is \gls[prereset]{etc}, which combines \glsreset{...} and \gls{...} in one macro.

I think if you want to typeset a term in long or full form in specific place after the first use, the recommended macros are \glsxtrfull{...}, \glsxtrlong{...}, or \glsxtrshort{...} for the full, long, and short forms, respectively; additionally, these macros are independent to global settings.

This code will produce the expected output

\documentclass{article}
\usepackage{glossaries-extra}

\setabbreviationstyle{long-only-short-only}

• Thanks @Celdor! I will do it manually. I was hoping there was an easier way, since I might mistakenly add an extra \gls{etc} somewhere in between the first few \glsxtrlong{etc} entries. In my real case, they are not so close together as in this MWE. Thanks again for your help! Dec 16, 2022 at 19:17