2

I have a document, which uses varioref. I chose the right language with babel and no matter if I choose one language or two, it always stays English instead of becoming German.

I checked already this out, but this doesn't seem to be the same problem: vref-uses-wrong-language-in-lyx-as-soon-as-i-use-two-languages

This is my MnWE:

\documentclass[10pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman,german]{babel}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{graphicx}


\begin{document}


\section{Geometrische Grundlagen}
\label{Geometrische_Grundlagen}
Die Grafik in Abbildung \ref{GeGrA} \vpageref{GeGrA} zeigt die Geometrie

\begin{figure}
\fbox{GRAPHIC}
\caption{Verschiedene geometrische Größen}
\label{GeGrA}
\end{figure}

\end{document}

Disabling hyperref didn't solve it. Putting varioref after hyperref didn't solve it either.

I use TeX-live on Regolith (Ubuntu) with Texmaker. System language is English, but the shell running texmaker from is switched to German (tested with Gnucash, definitely German).

2
  • 1
    Unrelated, but center around figure is wrong. Is there any reason for loading both ngerman and german?
    – egreg
    Feb 20, 2021 at 9:41
  • @egreg You are right, this is a residuum from a test. I should have deleted that. For the rest, see the comment on Ulrikes answer. Feb 20, 2021 at 9:49

1 Answer 1

8

varioref doesn't detect babel languages. You need to pass the option to it, either by package or documentclass option (I don't see the point to use both ngerman and german):

\documentclass[10pt,a4paper]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[ngerman]{varioref}
\usepackage{hyperref}
\usepackage{graphicx}


\begin{document}


\section{Geometrische Grundlagen}
\label{Geometrische_Grundlagen}
Die Grafik in Abbildung \ref{GeGrA} \vpageref{GeGrA} zeigt die Geometrie


\begin{figure}
\fbox{GRAPHIC}
\caption{Verschiedene geometrische Größen}
\label{GeGrA}
\end{figure}


\end{document}

enter image description here

2
  • From experience, some packages don't recognize ngerman, but german instead. I had one case long ago. Maybe it is not an issue any more. Simple solution. Actually obvious. But this is, how it is in hindsight. Feb 20, 2021 at 9:47
  • 1
    that would be a reason to use both as documentclass option, but not as package option for babel (and there you should put ngerman last). Feb 20, 2021 at 9:55

You must log in to answer this question.

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