[Tex/LaTex] How to correctly use newtxtext and newtxmath with luatex

fontsluatexnewtxmath

I know I must be doing something silly here, but I do not know what.

\documentclass[12pt]{article}%
\usepackage{amsmath}
\usepackage{fontspec}
\usepackage{newtxtext,newtxmath}

\begin{document}

This is my equation
$\mathbf{\dot{x}}=A x \mathbf{x}$

\end{document}

When compiled with lualatex foo.tex the math is missing the dot over the x.

>lualatex foo2.tex
This is LuaTeX, Version 1.10.0 (TeX Live 2019)
 restricted system commands enabled.
(./foo2.tex
LaTeX2e <2018-12-01>

luaotfload | main : initialization completed in 0.184 seconds
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size12.clo))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/expl3-code.tex
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3kernel/l3deprecation.def))
(/usr/local/texlive/2019/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def))
) (/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/tuenc.def))
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/newtxtext.sty
`newtxtext' v1.531, 2018/03/27 Text macros taking advantage of TeX-Gyre Termes
fonts (msharpe)
(/usr/local/texlive/2019/texmf-dist/tex/latex/fontaxes/fontaxes.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2019/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2019/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/local/texlive/2019/texmf-dist/tex/generic/xkeyval/keyval.tex))))
(/usr/local/texlive/2019/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/t1enc.def)
(/usr/local/texlive/2019/texmf-dist/tex/latex/lm/t1lmr.fd))
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/textcomp.sty
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1enc.def)))
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/newtxmath.sty
`newtxmath' v1.601, 2019/10/02 Math macros based originally on txfonts (msharpe
) (/usr/local/texlive/2019/texmf-dist/tex/latex/trimspaces/trimspaces.sty)
(/usr/local/texlive/2019/texmf-dist/tex/generic/ifxetex/ifxetex.sty)
(/usr/local/texlive/2019/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/local/texlive/2019/texmf-dist/tex/latex/oberdiek/centernot.sty)
(/usr/local/texlive/2019/texmf-dist/tex/generic/kastrup/binhex.tex))
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/t1ntxtlf.fd) (./foo2.aux)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/omlntxmi.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/untxexa.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/ts1cmr.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/lmsntxsy.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/lmxntxexx.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/ot1ntxtlf.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/untxmia.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/untxsym.fd)
(/usr/local/texlive/2019/texmf-dist/tex/latex/newtx/untxsyc.fd) [1{/usr/local/t
exlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./foo2.aux))
(see the transcript file for additional information)
 497 words of node memory still in use:
   6 hlist, 2 vlist, 2 rule, 2 glue, 4 kern, 2 sub_mlist, 1 glyph, 9 attribute,
 51 glue_spec, 9 attribute_list, 1 write nodes
   avail lists: 2:23,3:7,4:3,5:25,6:1,7:43,8:6,9:7,11:1
{/usr/local/texlive/2019/texmf-dist/fonts/enc/dvips/newtx/ntx-ot1-tlf.enc}{/usr
/local/texlive/2019/texmf-dist/fonts/enc/dvips/newtx/ntx-ec-tlf.enc}</usr/local
/texlive/2019/texmf-dist/fonts/type1/public/newtx/NewTXMI.pfb></usr/local/texli
ve/2019/texmf-dist/fonts/type1/public/tex-gyre/qtmb.pfb></usr/local/texlive/201
9/texmf-dist/fonts/type1/public/tex-gyre/qtmr.pfb></usr/local/texlive/2019/texm
f-dist/fonts/type1/public/newtx/txmiaX.pfb>
Output written on foo2.pdf (1 page, 34331 bytes).
Transcript written on foo2.log.
(base) >

Gives

Mathematica graphics

But it should be like this:

\documentclass[12pt]{article}%
\usepackage{amsmath}
\begin{document}

This is my equation
$\mathbf{\dot{x}}=A x \mathbf{x}$

\end{document}

Mathematica graphics

TL 2019

Best Answer

It is better to use OTF fonts with luatex, perhaps:

enter image description here

\documentclass[12pt]{article}%
\usepackage{amsmath}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
\begin{document}

This is my equation
$\mathbf{\dot{x}}=A x \mathbf{x}$

although perhaps better
$\dot{\symbf{x}}=A x \symbf{x}$

or
$\dot{\symbfit{x}}=A x \symbfit{x}$
\end{document}
Related Question