10

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

6
  • You could do \def\SIUnitSymbolMicro{\mu} … but that doesn’t look like the right font settings (unslanted)? Jun 12, 2013 at 20:38
  • I generated the expected output using \mathrm{\mu m}, so this means, there is an upright \mu. Jun 12, 2013 at 20:39
  • What I meant is that it does look like the unslanted version of the italic glyph. The output is the same as yours with my definition. Jun 12, 2013 at 20:41
  • According to unimath-symbols this is the only upright \mu. Internally siunitx tries to associate \textmu to \SIUnitSymbolMicro. Jun 12, 2013 at 20:47
  • I think the solution from another answer about the µ is the correct solution while using the non math version for the main text too: \sisetup{math-micro=\text{µ},text-micro=µ} (it uses the special micro sign of UTF and not a mu). Jun 12, 2013 at 20:48

2 Answers 2

8

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

1
  • Just for more information: the character can also be input in the \sisetup line as ^^b5, if it's somehow difficult to use the Unicode character directly.
    – egreg
    Jun 12, 2013 at 21:24
6

This seems to work

\documentclass{standalone}
\usepackage{unicode-math}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\usepackage[mode = math]{siunitx}
\def\SIUnitSymbolMicro{\textup{μ}}
\begin{document}


\SI{10}{\micro\m}
\end{document}

Note I needed to specify a text font as well.

enter image description here

2
  • Why \def and not \cs_set:Npn \SIUnitSymbolMicro {\textup{μ}}? Jun 12, 2013 at 21:10
  • 1
    @MarcoDaniel should be \newcommand probably. the packages use l3 internally but that doesn't mean you have to (or should) use l3 in the document preamble. \def is shorter than \newcommand so reduces the chance of a typo:-) Jun 12, 2013 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.