# Bold math using mathspec

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:

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?

-
Possibly related to tex.stackexchange.com/questions/603/math-in-trebuchet-ms. –  Ben Alpert Jul 31 '10 at 20:54
Maybe some clever usage of \setboldmathrm command (from fontspec package) can solve this problem (but I failed). –  Grigory M Aug 1 '10 at 19:23
At least it's possible to get bold math: \setmathsfont(Digits,Latin,Greek){Times New Roman Bold} Though all math would be bold then. –  Stefan Kottwitz Aug 15 '10 at 19:02

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}

-
Indeed it does. Thanks! –  Ben Alpert Aug 16 '10 at 6:18
Very good idea! –  Stefan Kottwitz Aug 16 '10 at 20:53