3

I am trying to put together an acronym list for my thesis using the package glossaries. However, in some cases I need to use a different grammar form of the item (German is a little complicated...) which is not equal to the singular or plural form.

The general question is: Is there a way to define a custom alias form of the item in-text WITHOUT affecting the detection of whether or not the acronym has already been introduced?

Here is my MWE:

\documentclass[a4paper,11pt,oneside]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}


\usepackage[acronym,shortcuts,toc]{glossaries} % Abkürzungsverzeichnis
\makeglossaries
\newacronym{EZM}{EZM}{extrazelluläre Matrix}

\begin{document}
In der \ac{EZM} befindet sich xyz. Die \ac{EZM} ist weiterhin xyz.
\printglossary[type=\acronymtype]
\end{document}

The text output is:

In der extrazelluläre Matrix (EZM) befindet sich xyz. Die EZM ist weiterhin xyz.

The glossary output is:

EZM extrazelluläre Matrix. 1

The glossary output is fine, but I would like my text output to look like this:

In der extrazellulären Matrix (EZM) befindet sich xyz. Die EZM ist weiterhin xyz.

(Note: there is an extra "n" in "extrazellulären")

Ideas?

2
  • I used acronym rather than glossaries hence I can only hint. But I would clone the plural form macros from the original .sty file to form dative (IIRC, my German was a long time ago) singular and plural equivalents. This would extend to other cases if required.
    – Chris H
    Commented Jul 21, 2016 at 13:38
  • @ChrisH Good idea. I added an 'alias' field using \glsaddkey. By then using the command \glsalias{EZM} I got the correct result (dative, indeed!), but the output was 'in der extrazellulären Matrix befindet...', so 'EZM' was missing and when I called the acronym for the second time using \gls{EZM} it printed 'Die extrazelluläre Matrix (EZM) ist...' although here it should only say 'Die EZM ist...'. How can I use the \glsaddkey command in combination with first use flag?
    – Tom
    Commented Jul 21, 2016 at 15:00

2 Answers 2

2

I got it to work using this code:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[acronym]{glossaries}
\usepackage{xspace}

\glsaddkey
 {alternative}% key
 {}% default value
 {\glsentryalternative}% no link cs
 {\Glsentryalternative}% no link ucfirst cs
 {\glsalternative}% link cs
 {\Glsalternative}% link ucfirst cs
 {\GLSalternative}% link all caps cs

\newcommand{\glslongalias}[1]{%
  \ifglsused{#1}{\glsalternative{#1}}{\glsalternative{#1} (\glsentrytext{#1})\glsunset{#1}}\xspace
}

\newacronym[
    alternative={extrazellulären Matrix}
]{EZM}{EZM}{extrazelluläre Matrix}

\makeglossaries

\begin{document}

In der \glslongalias{EZM} befindet sich xyz. Die \gls{EZM} ist weiterhin xyz.

\printacronyms

\end{document}
0

There are six "user keys" predefined in glossaries for this purpose. The keys are called user1...user6 and can be accessed using the roman-numerals-commands \glsuseri to \glsuservi (or the \Gls... and \GLS... forms). See glossaries manual section "4.2 Other Grammatical Constructs" for examples, and ways to give them custom alias names (macros).

I'll quote the relevant part of the manual here:

You can use the six user keys to provide alternatives, such as participles. For example:

\let\glsing\glsuseri
\let\glsd\glsuserii

\newcommand*{\ingkey}{user1}
\newcommand*{\edkey}{user2}

\newcommand*{\newword}[3][]{%
    \newglossaryentry{#2}{%
        name={#2},%
        description={#3},%
        \edkey={#2ed},%
        \ingkey={#2ing},#1%
    }%
}

With the above definitions, I can now define terms like this:

\newword{play}{to take part in activities for enjoyment}
\newword[\edkey={ran},\ingkey={running}]{run}{to move fast using
the legs}

and use them in the text:

Peter is \glsing{play} in the park today.
Jane \glsd{play} in the park yesterday.
Peter and Jane \glsd{run} in the park last week.

Alternatively, you can define your own keys using \glsaddkey, described below in Section 4.3.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .