Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

\documentclass[ngerman]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[acronym,shortcuts]{glossaries}
\makeglossaries

\begin{document}

\newacronym{max}{max.}{maximal}
\printglossary[type=\acronymtype]

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)

\end{document}

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.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

This seems to work:

\newcommand{\newacronymgerman}[6]{%
  \newacronym{#1}{#2}{\protect\gchoose{#3}{#4}{#5}{#6}}}
\newcommand{\acg}[2][N]{\csname choose#1\endcsname\ac{#2}\chooseN}
\newcommand{\chooseN}{\renewcommand\gchoose[4]{##1}}
\newcommand{\chooseA}{\renewcommand\gchoose[4]{##2}}
\newcommand{\chooseD}{\renewcommand\gchoose[4]{##3}}
\newcommand{\chooseG}{\renewcommand\gchoose[4]{##4}}
\newcommand{\gchoose}[4]{#1}

\newacronymgerman{<name>}{<abbrev>}{<Nom>}{<Akk>}{<Dat>}{<Gen>}

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

 \acg[<case>]{<name>}

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

share|improve this answer
    
Thanks a lot, I'll try it out as soon as I can! –  meep.meep Aug 24 '11 at 7:26
    
This principle is exactly what I needed. Thanks again. –  meep.meep Oct 14 '11 at 11:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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