3

This code can print \si{\us}

\RequirePackage{luatex85}
\documentclass[border=1cm]{standalone}
\usepackage{siunitx}

\begin{document}
Time \si{\us}
\end{document}

enter image description here

while this one doesn't print the desired output

\RequirePackage{luatex85}
\documentclass[border=1cm]{standalone}
\usepackage{mathtools}
\usepackage[tuenc,no-math]{fontspec}
\usepackage{unicode-math}
\usepackage{siunitx}

\begin{document}
Time \si{\us}
\end{document}

enter image description here

So, what packages are responsible for such a flaw? Additionally, in what order should I load them?

Diaa
  • 9,599

1 Answers1

10

This is imho due to a problem in unicode-math, \mathrm{\upmu} tries to output the symbol with the textfont and so you get missing character message. This affects siunitx as it uses internally \mathrm. I made a bug report: https://github.com/wspr/unicode-math/issues/438

A work-around is to use a text version of the mu, or to use a box:

\RequirePackage{luatex85}
\documentclass[border=1cm]{standalone}

\usepackage{unicode-math}
\usepackage{siunitx}
%\sisetup{math-micro=\hbox{$\upmu$},text-micro=µ} %works too
\sisetup{math-micro=\text{µ},text-micro=µ}
\begin{document}

$\mathrm{\upmu} %missing
 \mathrm{\hbox{$\upmu$}}$

\si{\us} \si[mode=text]{\us}
\end{document}
Ulrike Fischer
  • 327,261