# \bm not working for Latin or Digits letters when using mathspec to customize these

This is my MWE:

% !TEX program = xelatex
\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathspec}

\setmainfont{Times New Roman}
\setmathfont(Digits,Latin,Greek){Minion Pro}
\setmathrm{Minion Pro}

\begin{document}

This is MWE for testing.

A vector $\bm{d}$, a stress tensor $\bm{\sigma}$.

A vector $\mathbf{d}$, a stress tensor $\mathbf{\sigma}$.

A vector $\pmb{d}$, a stress tensor $\pmb{\sigma}$.

\end{document}


Output:

I want to get a Bold and Italic letter for Latin in Minion Pro font (or other customized fonts). The command \pmb in 'amsbsy' package can meet my need, but it looks like two letters overlapping together when you zoom in the file. And \mathbf cannot get the italic form although it can bold the letters. I can remove the option 'Greek' to let this set be CM font, so is there any other way except for \pmb to solve such problem? I have tried a command,

\SetSymbolFont{Digits:m:n}{bold}{EU1}{\eu@mathrm}{bx}{n}


from Getting bold digits with XeLaTeX and mathspec, but not working neither(error when running).

Could anyone give me a good solution?

• \bm would use the font set up for \boldmath but I;m not sure if minion pro math setup has bold math? (I don't have the fonts to check) – David Carlisle Apr 12 '19 at 13:03
• It doesn't matter even if you don't have Minion Pro. You can change it to Times New Roman or other fonts. This problem doesn't take place when running \usepackage[varg]{txfonts} instead of \setmathfont{<some fonts name>}, because this doesn't change the Latin letters from the default font (Computer Modern) to other fonts. I just want to keep the Greek letters in Computer Modern and change the Latin and Digits letters to my wanted fonts, which can be bold-italic. – Jerry John Apr 13 '19 at 4:37

Alright, I found a solution myself from How do I get XeLaTeX to use the bold Minion Pro typeface for Greek characters?. But the answer from him, i.e.

\makeatletter
%\DeclareMathVersion{bold}
\fontspec{Minion Pro} %sets \zf@family to minion pro.
\SetSymbolFont{Latin:m:n}{bold}{EU1}{\zf@family}{bx}{n}
\SetSymbolFont{Latin:m:it}{bold}{EU1}{\zf@family}{bx}{it}
\SetSymbolFont{operators}{bold}{EU1}{\zf@family}{bx}{n}
\SetSymbolFont{Greek:m:n}{bold}{EU1}{\zf@family}{bx}{n}
\SetSymbolFont{Greek:m:it}{bold}{EU1}{\zf@family}{bx}{it}

\fontspec{Linux Libertine O}
\SetSymbolFont{Digits:m:n}{bold}{EU1}{\zf@family}{m}{n}
\makeatother


runs on my computer (win10-1803, TeXlive 2018) with an error 'Encoding scheme EU1 unknown'. And here presents its definition.

Such encoding scheme belongs to package fontspec. Its documentation of a version (2018/07/30) says 'Since the default font encoding has changed from EU1/EU2 to TU, TU is a new Unicode font encoding ...... As a result, with this package option, Ross Moore’s xunicode package is not loaded', so I just changed the encoding scheme from EU1 to TU, i.e.

% !TEX program = xelatex
\documentclass{article}

\usepackage{amsmath,bm}
\usepackage{mathspec}

\setmainfont{Times New Roman}
\setmathfont(Digits,Latin,Greek){Minion Pro}
\setmathrm{Minion Pro}

\makeatletter
%\DeclareMathVersion{bold}
\fontspec{Minion Pro} %sets \zf@family to minion pro.
\SetSymbolFont{Latin:m:n}{bold}{TU}{\zf@family}{bx}{n}
\SetSymbolFont{Latin:m:it}{bold}{TU}{\zf@family}{bx}{it}
\SetSymbolFont{operators}{bold}{TU}{\zf@family}{bx}{n}
\SetSymbolFont{Greek:m:n}{bold}{TU}{\zf@family}{bx}{n}
\SetSymbolFont{Greek:m:it}{bold}{TU}{\zf@family}{bx}{it}
\makeatother

\begin{document}

This is MWE for testing.

A vector $\bm{d}$, a stress tensor $\bm{\sigma}$.

A vector $\mathbf{d}$, a stress tensor $\mathbf{\sigma}$.

A vector $\pmb{d}$, a stress tensor $\pmb{\sigma}$.

\end{document}


which works perfectly and solved my puzzle with an outcome like this: