3

I'm using the glossaries package for handling my acronyms. It's pretty fine but I would like to have always to long form instead of the short after the first use with the use of \gls.

Does anybody know how I can manage to use \gls and have the long form after the first appearance (without using \glsentrylong or \acrlong)?

MWE:

\documentclass{scrbook}
\usepackage{hyperref}
\usepackage[nonumberlist]{glossaries}

\newacronym[longplural={acronyms},shortplural={ACRs}]{REF}{ACR}{acronym}

\begin{document}
\noindent
First use: \Gls{REF}\\
2nd and following use: \gls{REF}

\printglossaries
\end{document}

I currently get this:

What I get

I would need this:

What I would need

0

1 Answer 1

1

The command \glsgenacfmt determines what exactly is printed when you typeset an acronym with \gls and friends. It uses the \glsentryshort (and the uppercase and plural forms) when the acronym has already been used.

We can redefine \glsgenacfmt and replace all instances of entryshort with entrylong. Then we get:

enter image description here

\documentclass{article}
\usepackage[nonumberlist]{glossaries}

\renewcommand*{\glsgenacfmt}{%
  \ifdefempty\glscustomtext{%
    \ifglsused\glslabel{%
      \glsifplural{%
        \glscapscase
          {\acronymfont{\glsentrylongpl{\glslabel}}\glsinsert}%
          {\acronymfont{\Glsentrylongpl{\glslabel}}\glsinsert}%
          {%
            \mfirstucMakeUppercase
              {\acronymfont{\glsentrylongpl{\glslabel}}\glsinsert}%
          }%
      }%
      {%
        \glscapscase
          {\acronymfont{\glsentrylong{\glslabel}}\glsinsert}%
          {\acronymfont{\Glsentrylong{\glslabel}}\glsinsert}%
          {%
            \mfirstucMakeUppercase
              {\acronymfont{\glsentrylong{\glslabel}}\glsinsert}%
          }%
      }%
    }%
    {%
      \glsifplural{%
        \glscapscase
          {\genplacrfullformat{\glslabel}{\glsinsert}}%
          {\Genplacrfullformat{\glslabel}{\glsinsert}}%
          {%
            \mfirstucMakeUppercase
              {\genplacrfullformat{\glslabel}{\glsinsert}}%
          }%
      }%
      {%
        \glscapscase
          {\genacrfullformat{\glslabel}{\glsinsert}}%
          {\Genacrfullformat{\glslabel}{\glsinsert}}%
          {%
            \mfirstucMakeUppercase
             {\genacrfullformat{\glslabel}{\glsinsert}}%
          }%
      }%
    }%
  }%
  {\glscustomtext}%
}

\setacronymstyle{long-short}

\newacronym[longplural={acronyms},shortplural={ACRs}]{REF}{ACR}{acronym}

\makeglossaries

\begin{document}

First use: \Gls{REF} \par
2nd and following use: \Gls{REF} and \gls{REF}

\printglossaries

\end{document}

Disclaimer: I am not terribly familiar with glossaries and I do hope there is an easier way, but I haven't found one. (That doesn't mean there isn't one, of course.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.