[Tex/LaTex] Customizing the first use of acronyms generated by glossaries


I manage my acronyms using the glossaries package. My minimal example is as follows:




Der \ac{max} Genuss (\textit{should be} maximale (max.) \textit{on first use})   \newline
Ein \ac{max} Genuss (\textit{should be} maximaler (max.) \textit{on first use})  \newline
Den \ac{max} Genuss (\textit{should be} maximalen (max.) \textit{on first use})  \newline
Der \ac{max} Genuss (maximale)


The base form of the acronym is maximal. On first use glossaries gives the output base form (abbr.) = maximal (max.). Sadly, in german you cannot be sure that you need the base form on first use. As the definition of \newacronym is equal to

\newglossaryentry{⟨label ⟩}{type=\acronymtype, 
name={ ⟨abbrv ⟩}, 
description={⟨long ⟩}, 
text={⟨abbrv ⟩}, 
first={⟨long ⟩ (⟨abbrv ⟩)}, 
plural={⟨abbrv ⟩\glspluralsuffix}, 
firstplural={ long \glspluralsuffix\space (abbrv \glspluralsuffix)}, 
⟨key-val list ⟩} 

I could just redefine the ⟨long ⟩-part of the first argument to the desired output. In this MWE, it would work just fine as I know which modification of maximal is the first. But my real file is much more voluminous and I won't really know which one is the first used modification in advance. So, when finishing I would have to search the whole document whether the first uses of all acronyms are correct.

So, I am searching for a way to implement that he modifications like maximale, maximaler, maximales, maximalen,… on first use and only on first use, like\acfirst{max}{way it is displayed if it's the first use}.

I already tried to work with the user1, ... ,user6 entries, but this modifies every use, not just if it's the first.

This question is related to this one, but unfortunately not quite so easy to solve.

Best Answer

This seems to work:

\newcommand{\acg}[2][N]{\csname choose#1\endcsname\ac{#2}\chooseN}


You put in the first argument the acronym symbolic name, in the second the acronym, in the other four the forms for Nominativ, Akkusativ, Dativ and Genitiv. Then you call the acronym with


where <case> stands for N (default), A, D or G. I hope you don't need also plural forms.