1

I am dealing with abbreviations. My most ones are in english, but my text is in german. Since it is not necessary to write out the long English word in the text, I only want it to be listed in the list of abbreviations, so that the German word and the English abbreviation appear in the text and the German and English word should appear int the list of abbreviations. I know that the acronym package isnt the best choice for it, but I used it for my work. May some can help. I found this, but there the English word is also displayed inside the text.

Here is a short MWE:

\documentclass[a4paper]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[printonlyused]{acronym}


\begin{document}
\begin{acronym}[eng]
\acro{eng}{German word}
\end{acronym}
\newpage
\ac{eng}
\end{document}
  • The simplest solution would be to use acro instead of acronym. – Skillmon Aug 21 '18 at 20:48
1

If I understood your question correctly you want to disable the output of \foreignlanguage from the linked answer in text. The following does so:

\documentclass[a4paper]{scrartcl}
\usepackage[ngerman]{babel}
\usepackage[printonlyused]{acronym}

\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}
\begin{acronym}[eng]
  \acro{eng}{\acroforeign{German word}}
\end{acronym}
\ac{eng}
\end{document}

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.