# Error “Extended mathchar used as mathchar” when using \bm

In an equation I want to use some bold calligraphic letters. This should be possible using \bm{\mathcal{X}}. However, even wenn using \bm{X} alone I get an error ("Extended mathchar used as mathchar"). I use xelatex from the latest MikTeX distribution.

Here is the MWE.

\documentclass{article}
\usepackage{unicode-math}
\setmainfont{XITS}
\setmathfont{XITS Math}
\usepackage{bm}
\begin{document}
This is a simple math example with a variable $k$.
This does not work $\bm{k}$.
What I actually need is this: $\bm{\mathcal{X}}$ and $\bm{\Theta}$.
\end{document}

Do I do something wrong or is there a bug in XeLaTeX or in one of the packages?

With unicode-math you don't generally need bm:

\documentclass{article}
\usepackage{unicode-math}

\setmainfont{XITS}
\setmathfont{XITS Math}

\begin{document}

This is a simple math example with a variable $k$.
This works $\symbfit{k}$.
What I actually need is this: $\mathbfcal{X}$ and $\symbf{\Theta}$.
Compare with $\mathcal{X}$ and $\Theta$.

\end{document}

• Thank you! That's cool! Although now I have to change all occurences of \bm in my old code... – Mik May 10 '18 at 17:28