[Tex/LaTex] unicode-math/mathspec interferes with siunitx

siunitxunicode-mathxetex

The Problem

I'm using unicode-math and the font TeX Gyre Pagella Math. Also, I use siunitx to denote my quantities. Unfortunately, the option \micro of siunitx doesn't get expanded to µ, but is dropped.

(The same behaviour can be observed when using mathspec in XeLaTeX)

Minimal working example

Compile with Xe/LuaLaTeX.

\documentclass{standalone}
\usepackage{unicode-math}
\setmathfont{TeX Gyre Pagella Math}
\usepackage[mode = math]{siunitx}
\begin{document}
\SI{10}{\micro\m}
\end{document}

Output

real

Expected output

expected

Best Answer

As explained in an answer by nlogax to microtype + siunitx and \micro - mysterious warnings Unicode has—besides the Greek Small Letter Mu character µ—a special Micro Sign µ.

That is to be used here. For some reason this is not present in unicode-math.
I assume that you also use TeX Gyre Pagella as your text font so we can use it from there with \text.

Code

\documentclass{standalone}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\usepackage[mode = math]{siunitx}
\sisetup{math-micro=\text{µ},text-micro=µ}
\begin{document}
\SI{10}{\micro\m}
\SI[mode=text]{10}{\micro\m} % just for reference
\end{document}

Output

enter image description here

Related Question