[Tex/LaTex] Ignoring an acronym that is only used once


I am using the glossaries package only for its acronym capabilities, and I have one or two that are only used once in the document. For those acronyms, is there a way to only display the full text?

Specifically, the default is for \gls{dft} to display

density functional theory (DFT),

but I'd like it to only display

density functional theory

if the acronym is only used once.

Best Answer

If you want to get the long form of an acronym—independently of the selected acronym style and the context where the acronym is used—I think it's best to simply use \acrlong or \acl. Note that the latter command is only defined if the shortcuts option of the glossaries package is set.

Edit: Werner has pointed out in a comment to his answer that it is probably possible to extend the glossaries package such that acronyms are printed in a distinct way if they are used only once in the document. The following patch shows that this can indeed be done:




  \newbool{glo@\the\glslabeltok @usedonlyonce}% define an additional switch per acronym

}{% write appropriate information to the main auxiliary file

}{% print the long form of the acronym if the acronym is used only once


\newacronym{ANO}{ANO}{Acronym Number One}
\newacronym{ANT}{ANT}{Acronym Number Two}




\gls{ANO}, \gls{ANO}\\


Obviously, you need two LaTeX runs to get everything right. Moreover, if you use not only \gls (\ac), but also \Gls (\Ac), \GLS, \glspl (\acp), \Glspl (\Acp) and \GLSpl you have to patch \@Gls@, \@GLS@, \@glspl@, \@Glspl@ and \@GLSpl@ in the same way as \@gls@.

The resulting output is:

Related Question