TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using XeTeX and fontspec, and I have selected old-style figures for my body text. Now I use the siunitx package, and have set it up to use text fonts instead of math fonts. For the siunitx values I want to use lining figures instead of old-style figures. How do I do this?

I have tried this, but it does not work:

\setromanfont[Numbers=OldStyle]{Arno Pro}
\sisetup{mode = text}
\sisetup{inter-unit-separator =\cdot}
{\fontspec[Numbers={Lining}]{Arno Pro}\SI{10}{\kilo\volt\per\centi\metre}}

Furthermore, siunitx uses the math font comma instead of the text font comma when using

 \sisetup{output-decimal-marker ={,}}
share|improve this question
Is there a convenient free font offering old style numbers? I don't have Arno Pro to test this. – Joseph Wright Jan 14 '11 at 21:19
Calibri offers them, Cambria too. – Ruud Jan 14 '11 at 21:22
The libertine font – Herbert Jan 14 '11 at 21:25
@Ruud: Calibri and Cambria aren't free. – Philipp Jan 14 '11 at 21:48
@Joseph: Herbert has already mentioned Linux Libertine, others are Antykwa Poltawskiego, Antykwa Torunska, Asana Math, Computer Modern, Cyklop, GFS Artemisia, GFS Baskerville, GFS Bodoni, GFS Didot, GFS Neohellenic, Iwona, Kurier, Latin Modern, Linux Biolinum, Neo Euler, TeX Gyre Adventor, TeX Gyre Bonum, TeX Gyre Chorus, TeX Gyre Cursor, TeX Gyre Heros, TeX Gyre Pagella, TeX Gyre Schola, TeX Gyre Termes, Vollkorn, XITS. TeX Live alone contains dozens of those. – Philipp Jan 14 '11 at 21:49
up vote 10 down vote accepted

Font detection in siunitx uses the document defaults unless you provide something else. So in your example your getting \rmfamily. The key is to define a font command which will select what you want.

\setromanfont[Numbers=OldStyle]{Linux Libertine O}
\newfontfamily\liningroman[Numbers={Lining}]{Linux Libertine O}
\sisetup{mode = text,number-text-rm = \liningroman}

I see that there is a second part to the question, asking about the output-decimal-marker option. As detailed in the manual, this is a math mode option. If you want to force this to be in text mode you need to use \text:

\setromanfont[Numbers=OldStyle]{Linux Libertine O}
\newfontfamily\liningroman[Numbers={Lining}]{Linux Libertine O}
\sisetup{mode = text,number-text-rm = \liningroman,
share|improve this answer
You shouldn't use \newcommand and \fontspec to do this. You should use fontspec's \newfontfamily command: \newfontfamily\liningroman[Numbers={Lining}]{Linux Libertine O} – Alan Munn Jan 15 '11 at 0:53
@Alan. Altered - I can't say I use the fontspec beyond loading it, so I've never had occasion to set up a new font family before. – Joseph Wright Jan 15 '11 at 6:20
The reason is that when you put \fontspec to select a font into a command like that, every time you use the command, it has to parse the font features over again; the \newfontfamily kind of encapsulates the features and is therefore much more efficient. – Alan Munn Jan 15 '11 at 13:30
This solution works perfectly, thank you very much! – Ruud Jan 15 '11 at 15:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.