This issue is not new on this site, but I’ve tried earlier solutions and neither works for me. Related questions:
- Math digits are rendered in CM when using libertine and newtxmath with XeLaTeX in TeX Live 2016
- Caveats of newtxmath and fontspec together
My goal is to use newtxmath together with setting system OpenType fonts through fontspec. No matter in which order I load the package, the digits in math mode are rendered in Computer Modern, not Times.
% !TEX program = lualatex
\documentclass[12pt,a4paper]{article}
\usepackage{newtxmath}
\usepackage[no-math]{fontspec}
\setmainfont{Times New Roman}
\begin{document}
Text: 2, Math: \(x=\sqrt{2}\)
\end{document}
Per the newtxmath documentation:
As far as I can tell, newtxmath works with both [XeLaTeX and LuaLaTeX], but requires a very specific loading order and choice of options. [...] the math options must all be loaded prior to loading and using fontspec.
Which I’ve done right in my opinion. My packages are all up-to-date as well.
I’ve tried to adapt this answer for the Times font, but couldn’t make it work.




nextxpackage is (still) correct. For sure,\usepackage[no-math]{fontspec}followed by\usepackage{newtxtext,newtxmath}works fine. – Mico Oct 01 '17 at 18:12newtxtextfonts. – lblb Oct 01 '17 at 18:29newtxis based on TeX Gyre Termes, why not just useunicode-mathand\setmathfont{TeX Gyre Termes Math}? – Henri Menke Oct 01 '17 at 20:13\piis disturbingly mirrored with theTeX Gyre Termes Mathfont. – lblb Oct 01 '17 at 20:20