[Tex/LaTex] Sans-serif bold math with newtxmath

boldfontsmath-modenewtxmathsans-serif

I'm writing an article whose math font needs to be Times New Roman. To this end, I'm using the newtxmath package. However, it doesn't seem to support sans-serif bold in math mode.

Usually I can write

\documentclass{article}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

\begin{document}

Sans serif, no bold: $\mathsf{A}, \mathsf{\Omega}$

Sans serif, bold: $\boldsymbol{\mathsf{A}}, \boldsymbol{\mathsf{\Omega}}$

\end{document}

which produces

Correct output, no newtxmath

However, when the newtxmath is included

\documentclass{article}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{newtxmath}

\begin{document}

Sans serif, no bold: $\mathsf{A}, \mathsf{\Omega}$

Sans serif, bold: $\boldsymbol{\mathsf{A}}, \boldsymbol{\mathsf{\Omega}}$

\end{document}

one gets

Wrong output with newtxmath

Is there any workaround to this? Using mathptmx instead isn't the best option, since I also need upright Greek symbols which are provided automatically in newtxmath.

Best Answer

You should also load newtxtext, for the text fonts. A small correction should be made as well, for \mathsf{\Omega}. Also load bm, which is better than the standard version for \boldsymbol provided by amsmath. You can also use \bm instead of \boldsymbol.

\documentclass{article}

\usepackage{amsmath}
\usepackage{bm}
\usepackage{newtxtext,newtxmath}

\DeclareMathAlphabet{\mathsf}{OT1}{\sfdefault}{m}{n}
\SetMathAlphabet{\mathsf}{bold}{OT1}{\sfdefault}{b}{n}


\begin{document}

Sans serif, no bold: $\mathsf{A}, \mathsf{\Omega}$

Sans serif, bold: $\boldsymbol{\mathsf{A}}, \boldsymbol{\mathsf{\Omega}}$

\end{document}

enter image description here