7

I used to use Luatex and a combination of the packages fontspec and newtxmath to have everything set in Libertine. However, it does not work anymore since Texlive 2015: it compiles be the digits in math-mode are set in Computer modern and not Libertine.

Here a minimal example:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[libertine]{newtxmath}

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

\begin{document}
123 $123$ --- \emph{a} $a$
\end{document}

It used to work with both LuaTex and Xelatex, but now it works with none. With Xelatex, I can solve the problem with mathspec, by specifying explicitly the font for the digits, but for Luatex, I have no fix. The log reveals nothing (no warning, no errors).

Any idea ?

1 Answer 1

6

The same workaround as for package clash fontspec eulervm amsmath applies, both for XeLaTeX and LuaLaTeX.

\documentclass{article}

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

\DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}

\begin{document}
123 $123$ --- \emph{a} $a$
\end{document}

Loading fontenc is completely useless.

enter image description here

2
  • Nice ! (I put fontenc because newtxmath's doc says so... But indeed, it is useless.)
    – Lierre
    Commented Nov 22, 2015 at 15:54
  • @Lierre - The packages inputenc and fontenc should not be loaded under LuaLaTeX and XeLaTeX.
    – Mico
    Commented Nov 22, 2015 at 16:46

You must log in to answer this question.

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