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
    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
    Jul 21, 2016 at 15:00

1 Answer 1

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}

You must log in to answer this question.

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