Libertine + newtxmath = misaligned accents in bold math

accentshorizontal alignmentlibertinenewtxmath

I have a problem with misaligned \tilde accents in bold math using the newtxmath with the libertine option. It seems that the \tilde accent is slightly left-aligned when using \bm (compared to when not using \bm). The following code and image demonstrate this. Is there an easy way to re-align the accent when using \bm in my setting?

By the way, I am using TeX Live 2019 on mac.

\documentclass[11pt]{article}
\usepackage{libertine}
\RequirePackage[libertine]{newtxmath}
\usepackage{bm}
\begin{document}
$\tilde{\bm{g}}$ $\tilde{g}$
\end{document}

enter image description here

Best Answer

Using pdflatex with latest TeXLive 2021 on Linux, I see no problem

>pdflatex foo.tex
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./foo.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-08-27>
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/size11.clo))
(/usr/local/texlive/2021/texmf-dist/tex/latex/libertine/libertine.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/ifxetex.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/local/texlive/2021/texmf-dist/tex/generic/iftex/ifluatex.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/local/texlive/2021/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/local/texlive/2021/texmf-dist/tex/generic/xkeyval/keyval.tex))))
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/textcomp.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/fontaxes/fontaxes.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/libertine/LinLibertine_I.tex))
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/newtxmath.sty
`newtxmath' v1.655, 2021/06/01 Math macros based originally on txfonts (msharpe
) (/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2021/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/oberdiek/centernot.sty)
(/usr/local/texlive/2021/texmf-dist/tex/generic/kastrup/binhex.tex))
(/usr/local/texlive/2021/texmf-dist/tex/latex/tools/bm.sty)
(/usr/local/texlive/2021/texmf-dist/tex/latex/libertine/OT1LinuxLibertineT-TLF.
fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def)
(./foo.aux) (/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/omlnxlmi.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxexa.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/lmsntxsy.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/lmxntxexx.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxmia.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxsym.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxsyc.fd) [1{/usr/local/t
exlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./foo.aux) ){/usr/l
ocal/texlive/2021/texmf-dist/fonts/enc/dvips/libertine/lbtn_oexx6f.enc}</usr/lo
cal/texlive/2021/texmf-dist/fonts/type1/public/newtx/LibertineMathBMI.pfb></usr
/local/texlive/2021/texmf-dist/fonts/type1/public/newtx/LibertineMathMI.pfb></u
sr/local/texlive/2021/texmf-dist/fonts/type1/public/libertine/LinLibertineT.pfb
>
Output written on foo.pdf (1 page, 82381 bytes).
Transcript written on foo.log.

Here is the PDF output

enter image description here

Using lualatex gives warning

(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/lmxntxexx.fd)

LaTeX Font Warning: Font shape `OT1/LinLibertine(0)/m/n' undefined
(Font)              using `OT1/cmr/m/n' instead on input line 7.

(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxmia.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxsym.fd)
(/usr/local/texlive/2021/texmf-dist/tex/latex/newtx/untxsyc.fd)

LaTeX Font Warning: Font shape `OT1/LinLibertine(0)/sb/n' undefined
(Font)              using `OT1/LinLibertine(0)/m/n' instead on input line 7.

[1{/usr/local/texlive/2021/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./foo.aux)

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

)

and it gives this in PDF

enter image description here

I do not know which compiler or tex distribution you used since you did not mention it.

Update

Thanks to comment by Mico, Loading bm before gives this output

\documentclass[11pt]{article}
\usepackage{bm} %moved this here
\usepackage{libertine}
\RequirePackage[libertine]{newtxmath}

\begin{document}
$\tilde{\bm{g}}$ $\tilde{g}$
\end{document}

enter image description here