2

How can I use the translations package to define multi-lingual newtheorem environments as in:

\documentclass{article}
\usepackage[german]{babel} 
\usepackage{translations}
\usepackage[thmmarks,hyperref]{ntheorem}

\DeclareTranslationFallback{example}{Example}
\DeclareTranslation{German}{example}{Beispiel}

\newtheorem{Theorem}{Theorem}[section]
\newtheorem{Example}[Theorem]{\GetTranslation{example}}

\begin{document}

\begin{Example}
    content...
\end{Example}

\end{document}

I just get an error

undefined control sequence

1
  • Which control sequence is undefined?
    – Bernard
    Dec 12, 2019 at 20:00

1 Answer 1

3

This is due to ntheorem: add \protect in front of \GetTranslation.

\documentclass{article}
\usepackage[german]{babel}
\usepackage{translations}
\usepackage[thmmarks,hyperref]{ntheorem}

\DeclareTranslationFallback{example}{Example}
\DeclareTranslation{German}{example}{Beispiel}

\newtheorem{Theorem}{Theorem}[section]
\newtheorem{Example}[Theorem]{\protect\GetTranslation{example}}

\begin{document}

\begin{Example}
    content...
\end{Example}

\end{document}

enter image description here

You must log in to answer this question.

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