7

I am currently using the acronym package to handle acronyms/abbreviations in my thesis.

I am writing in German, but I use a couple of English acronyms because either no German acronym exists or the English one simply more commonly used. So when introducing the acronym, I want/need to use the German word in text (as "long" form) but I want to include the English long form in parentheses alongside the (English) acronym. And of course, both German and English should show up in the list of acronyms.

  • German Term: Steuergerät
  • English Term: Electronic Control Unit
  • Acronym: ECU

So in my text I'd like to have:

.... Steuergerät( Electronic Control Unit, ECU) ....

and later simply have

.... ECU ....

In the list of acronyms, it should show up as:

ECU Steuergerät (Electronic Control Unit)

or

ECU Electronic Control Unit (Steuergerät)

Is there a way to include a translation in the long version of an acronym?

EDIT: As pointed out by @NicolaTalbot, the use case is the same than Using the glossaries package for English acronyms in German documents. Is there a way to achieve this with the acronym package as well or do I need to switch packages?

  • Welcome to TeX-SX! You may have a look at our starter page for a quick intro if you wish to familiarize yourself with our format. – Claudio Fiandrino May 3 '13 at 17:47
  • 3
    Do you mean something like Using the glossaries package for English acronyms in German documents? – Nicola Talbot May 3 '13 at 20:01
  • @NicolaTalbot Yes, that pretty much looks like what I am after...Is there a way to do this with the acronym package as well? – Johannes S. May 4 '13 at 6:09
  • 1
    @JohannesS.Sorry, I don't know how to do this with acronym as I've never used that package. If you do decide to switch, the glossaries package option shortcuts will enable commands like \ac and \acs. – Nicola Talbot May 4 '13 at 8:20
  • 1
    For what it's worth: the acro package v1.3 provides the foreign key for this. – clemens May 8 '13 at 7:18
6

As I already said in the comments: acro provides the foreign key for cases like this. Nonetheless: here is a way to achieve what you want with acronym. The usage is similar to acronym's \acroextra. The code below defines a command \acroforeign{<foreign long form>} that is to be placed inside the second mandatory argument of \acro:

\begin{acronym}
  \acro{<short>}{<long>\acroforeign{<foreign>}}
  ...

The MWE below gives:

enter image description here

\documentclass{article}
\usepackage{acronym}

% provides \AtBeginEnvironment, \patchcmd and \csdef:
\usepackage{etoolbox}

\makeatletter
\newcommand{\acroforeign}[1]{}

% patch the environment to print the foreign definition:
\AtBeginEnvironment{acronym}{%
  \def\acroforeign#1{ (#1)}%
}

% patch the acronym definition to safe the foreign definition:
\patchcmd\AC@@acro
  {\begingroup}
  {\begingroup\def\acroforeign##1{\csdef{ac@#1@foreign}{##1, }}}
  {}
  {}

% renew the first output to include the foreign definition if given:
\renewcommand*{\@acf}[1]{%
  \ifAC@footnote
    \acsfont{\csname ac@#1@foreign\endcsname\AC@acs{#1}}%
    \footnote{\AC@placelabel{#1}\hskip\z@\AC@acl{#1}{}}%
  \else
    \acffont{%
      \AC@placelabel{#1}\hskip\z@\AC@acl{#1}%
      \nolinebreak[3] %
      \acfsfont{(\acsfont{\csname ac@#1@foreign\endcsname\AC@acs{#1}})}%
    }%
 \fi
 \ifAC@starred\else\AC@logged{#1}\fi
}
\makeatother

\begin{document}

First: \ac{ECU}, \ac{BW}

Subsequent: \ac{ECU}, \ac{BW}

List:
\begin{acronym}[ECU]
  \acro{ECU}{Steuerger\"at\acroforeign{Electonic Control Unit}}
  \acro{BW}{Baden-W\"urttemberg}
\end{acronym}

\end{document}
  • The acro package is working great. – Johannes S. Sep 30 '13 at 13:53

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.