[Tex/LaTex] Bold math using mathspec

boldfontsmathspecxetex

I can't seem to make my math come out in bold using the mathspec package. Consider this example:

\documentclass{article}

\usepackage{mathspec}
\setallmainfonts{Times New Roman}

\begin{document}

\textbf{This line should all be bold: {\boldmath $17^2 = 289$}.}

\end{document}

When compiled, it gives:

bm

If mathspec is not used, then the math is bold, like it should be. How can I make my custom-font math bold as well?

Best Answer

Separating out the font setting for math and text seems to work

\documentclass{article}
\usepackage{mathspec}
\setmainfont{Times New Roman}
\setmathfont{Times New Roman}

\begin{document}

\textbf{This line should all be bold: {\boldmath $17^2 = 289$}.}

\textbf{This line should all be bold except the
math: {$17^2 = 289$}.}

\end{document}