I’m trying to use Linux Libertine in both text and math mode with XeLaTeX in TeX Live 2016.
Back in TeX Live 2014, I was able to achieve this using libertine and
newtxmath packages, as suggested in this answer:
\usepackage[libertine]{newtxmath}
\usepackage[no-math]{fontspec}
\usepackage{xltxtra}
\usepackage{libertine}
However, this solution is broken in TeX Live 2016, since numbers and roman text
in math mode are displayed in Computer Modern. Interestingly, removing the
no-math option from fontspec fixes the issue with roman text, leaving only
numbers in math mode to be rendered in CM. Here is a MWE:
\documentclass{article}
\XeTeXdefaultencoding utf-8
\usepackage[libertine]{newtxmath}
\usepackage{xltxtra} % loads fontspec and xunicode
% note that removing `xltxtra` does not affect how the output
\usepackage{libertine}
\begin{document}
Quite some text 123, $123$.
$3 \sin x \alpha$
\begin{displaymath}
\int_0^{+\infty} \left(\frac{\alpha}{\sqrt{\Omega_\Lambda - 1}}\right)^{\frac{1}{x}}
\mathrm{d}x
\end{displaymath}
\end{document}
As you can see, arabic numbers are rendered in CM, and other symbols are in Linux Libertine.
So here’s the big question: How can I get both text and math to render in
Linux Libertine using newtxmath and libertine packages?
I would rather not use alternatives such as mathspec (last updated in 2009),
unicode-math (last time I checked, it gave terrible results like these),
or other \setmathfont / \setmainfont.
Besides, I’ve done some serious browsing on TeX.sx, and tried stuff proposed in many different answers, without any luck. These include:



xltxtranot recommended? – Arcturus B Jan 07 '17 at 16:12fontspecwithno-math, and using\DeclareSymbolFont{operators}{\encodingdefault}{\familydefault}{m}{n}gives a similar output. Any comments on that? – Arcturus B Jan 07 '17 at 16:13c:\texlive\2017\texmf-dist\tex\latex\base\article.cls:20: Invalid math code during > 0x8000 mathcode fallback. [\begin{document}]with LuaLaTeX under TeXLive 2017. – lblb Oct 01 '17 at 17:29