2

It seem's that I'm doing something wrong for localizing siunitx. What could it please be?

Here is the code:

\documentclass[11pt,a4paper,german]{article}
\usepackage[ngerman]{babel} 
\usepackage{fontspec}
\usepackage{siunitx} %Einheiten
\selectlanguage{german}
\sisetup{
        locale = DE ,
        per-mode = symbol, %nichts ist ^-1 symbol 
    }
%\selectlanguage{german} % oder lokal umstellen

\begin{document}
    Dieser Bereich geht von \SIrange{0}{100}{\joule}

    Dieser Bereich geht von \SIrange{0}{100}{\joule}\selectlanguage{german}
\end{document}

And in the attached picture there is the output using lualatex. The to should be a bis or a symbol like .

Output example of \SIRange

Thank you very much.

3
  • \documentclass[...,ngerman]{article} and no \selectlanguage should work with babel
    – cgnieder
    Feb 6, 2017 at 15:28
  • 2
    german is no valid babel language IIRC
    – cgnieder
    Feb 6, 2017 at 15:31
  • Thanks that was it. Using ngerman it works.
    – TimK
    Feb 6, 2017 at 15:39

2 Answers 2

5

Thanks to @clemens I used german with babel and that doesn't work. Therefore using just ngerman (new german, because of a change in spell and grammar checking) localisation works now.

\documentclass[11pt,a4paper,ngerman]{article}
\usepackage[ngerman]{babel} 
\usepackage{fontspec}
\usepackage{siunitx} %Einheiten
\sisetup{
        locale = DE ,
        per-mode = symbol, %nichts ist ^-1 symbol 
    }
%\selectlanguage{german} % oder lokal umstellen

\begin{document}
    Dieser Bereich geht von \SIrange{0}{100}{\joule}

    Dieser Bereich geht von \SIrange{0}{100}{\joule}
\end{document}

Code Compilation - Success

3

Localisation is probably a little misleading here. Siunitx localisation only covers exponent-product, inter-unit-product, output-decimal-marker.

You will have to set range-phrase manually.

3
  • Well, it does work. :)
    – TimK
    Feb 6, 2017 at 15:43
  • 2
    That is not related to locale option, that is because it looks for the translator package and have it translate bis and in this case german is not a supported language. You can easily have a german doc with a UK locale option.
    – daleif
    Feb 6, 2017 at 15:49
  • 1
    OK, thank you very much for this clarification! It makes absolutely sense. When the to instead of the bis appeared, I tried the wrong way.
    – TimK
    Feb 6, 2017 at 16:07

You must log in to answer this question.

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