# Font mismatch with Linux Libertine and siunitx package

Following example:

\documentclass{scrbook}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{microtype}
\usepackage{siunitx}

\usepackage{fontspec}
\setmainfont{Linux Libertine O}
\usepackage[libertine]{newtxmath}
\setkomafont{sectioning}{\normalcolor\bfseries}

\begin{document}
\chapter{Test}
Anhand einer Kalibrationsgerade des Photolinkers in DMSO konnte der Extintionskoeffizient des Photolinkers $\epsilon_{PL}$ im
Konzentrationsbereich $c_{PL-02}$: \SI{0.02}{\micro\mole\per\liter} -
\SI{0.1}{\micro\mole\per\liter} bestimmt werden. Mittels des  Extintionskoeffizienten
$\epsilon_{PL}=15766$ des Phototolinker und dem Lambert-Beer Gesetz wurde die
folgende Gleichung zur Bestimmung des DS, hergeleitet.
\end{document}


Now the number in the math environment (which looks really big) does not match the one in the siunitx environment. Why is this and is there a better way to have a font match between this two? I should mention I use lualatex.

-
Yes it does! Thanks! I should mention that I get also a lot of checksum mismatch in font <bla>.vf ignored messages. Is now the package newtxmath in charge for the math mode? –  Reza Feb 8 '13 at 6:48

This has nothing to do with siunitx: it's the font used for numbers in math mode that's wrong.

You can solve the issue with this block of font settings:

\usepackage[libertine]{newtxmath}
\usepackage[no-math]{fontspec}
\setmainfont{Linux Libertine O}

%%% Uncomment the following line, if something is still wrong
% \DeclareSymbolFont{operators}{OT1}{LinuxLibertineO-LF}{m}{n}


The commented line might be needed, depending on the installed version of newtxmath.sty, which has undergone several changes in the last months.

The messages about checksum mismatches with LuaLaTeX are innocuous, albeit annoying.

-
Shouldn't newtx take care of this? As I understand, the main idea behind this package is to create a math appearance that perfectly fits the main text. And the figures (numbers) are a main part of this, of course. So, why are the numbers not set in Libertine although we use \usepackage[libertine]{newtxmath}? –  Jan-Philip Gehrcke Jun 25 at 12:07
@Jan-PhilipGehrcke The no-math option to fontspec is making the difference; without it, fontspec hijacks the operators font. –  egreg Jun 25 at 12:09
Okay, but the (in my naive view) established \usepackage{libertine} can not be used to achieve the effect, we need to use \setmainfont{Linux Libertine O} in order to get Libertine numbers, right? All this appears quite magic to me. –  Jan-Philip Gehrcke Jun 25 at 12:37
My last comment is wrong, \usepackage{libertine} just needs to be declared after loading fontspec, as Herbert points out below. –  Jan-Philip Gehrcke Jun 25 at 12:44

with current TeXLive there is no problem. However, all font stuff depending to the old LaTeX loading mechanism should be done before you load the OpenType fonts:

[...]
\usepackage[libertine]{newtxmath}
\usepackage[no-math]{fontspec}
\usepackage{libertine}
[...]

-