1

As of late, I switched from pdflatex to luatex. I took an example file from the German Wikipedia and compiled it without error (TeXlive 2016 btw). Now, I noticed that when employing \autoref, which I'm quite used to, the labels are printed in English instead of German, albeit I \setdefaultlanguage to German! I've composed the following MWE to demonstrate this behavior:

%% MWE to show a problem with \autoref in LuaLaTeX
\documentclass[a4paper, 12pt]{scrartcl}

\usepackage{polyglossia}
\setdefaultlanguage[spelling=new, babelshorthands=true]{german}

\usepackage{unicode-math}
\usepackage{mathtools}
\usepackage{esdiff}

\parindent0mm
\usepackage{hyperref}

\title{Formeln zur Berechnung der Masse der Alpen}
\author{Otto Normalverbraucher}
\date{\today}

\begin{document}

\maketitle

Es geht los mit der ersten Gleichung.
\begin{equation}
M_l c_l \diff{T_B}{t} = 
-h_{int} A (T_B - T_E) - \dot{M}_l c_l (T_B - T_{amb})
\end{equation}

Danach folgt \autoref{eq:wandbilanz}.
\begin{align}
M_E c_E \diff{T_E}{t} &= h_{int} A (T_B - T_E) - h_{rain} A (T_E - T_{rain}) + \rho_B \dot{V}_{cond} \Delta h_{cond} \label{eq:wandbilanz} \\
\dot{V}_{cond} &= \beta [ y_{vap}(T_B) - y_{vap}(T_E) ] A
\end{align}

\end{document}

Note that the date is printed correctly in the German notation, but then it gives "Equation 2" instead of "Gleichung 2". Any idea how to fix this? PDF output of the MWE

2

The simplest solution I can think of to the problem you've identified is to add the option

ngerman

to the list of options of the \documentclass instruction. Thus, you should write:

\documentclass[a4paper, 12pt,ngerman]{scrartcl}

Alternatively, you could elect to load the babel package (with the lagnuage option ngerman, of course) instead of the polyglossia package. That way, you'd also get "Gleichung" instead of "equation" as the label associated with the counter equation.

| improve this answer | |
  • One can also add the language option to the hyperref options (\usepackage[german]{hyperref}) – Ulrike Fischer Aug 5 '16 at 13:41
  • @UlrikeFischer - Thanks. By setting the document class-wide option ngerman or german -- the OP had specified the polyglossia option spelling=new, which leads me to believe he/she is more interested in ngerman than in german... -- the language option is automatically passed to the hyperref package (and to all other packages too, whether or not they do something with this option...). Setting the language option at the document class level may be advantageous if the OP loads other language-aware packages in addition to hyperref-- say, cleveref. – Mico Aug 5 '16 at 16:40
  • Great, it works; I just thought that with lualatex, one should use polyglossia instead of babel!? – rotton Aug 10 '16 at 15:40
  • @rotton - Nowadays, one can use both babel and polyglossia with LuaLaTeX. Which package to choose should depend mainly on the language-specific support offered by the packages, for the language(s) you use in your document. – Mico Aug 10 '16 at 16:01

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.