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 ?

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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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