Closed u-fischer closed 6 years ago
This is not fixed in v0.8l and still an issue (Even in TL2018 pretest)
\documentclass{scrartcl}
\usepackage{fontspec}
\usepackage{mathtools}
\usepackage{unicode-math}
\setmathfont{Latin Modern Math}
\usepackage{siunitx}
% \sisetup{math-micro=\text{µ},text-micro=µ} % this fixes it
\begin{document}
\SI{10}{\milli\second} \\
\SI{10}{\micro\second} \\
\SI{10}{\nano\second}
\end{document}
The problem is solved. My example above shows in texlive 2018 (and in texlive 2017) three mu's. But this doesn't mean that siunitx directly will use it, only that it is now possible in a sane way to tell siunitx about the micro, e.g.:
\documentclass{article}
\usepackage{unicode-math}
\usepackage{siunitx}
\sisetup{detect-mode,math-micro=\upmu,text-micro=µ}
\begin{document}
Time $\si{\us}$ \si{\us}
$\mathrm{\upmu} \mathrm{\symrm{\upmu}} \mathrm{\hbox{$\upmu$}}$
\end{document}
So you say this is a siunitx issue now?
It shouldn't be necessary to do any special \sisetup
to get a working \micro
.
Yes.
I don't really get it. Because this used to work and it was unicode-math
which changed, not siunitx. Also it's very unfortunate that this broke just before TL2017 was frozen.
I don't have time right now to fully unpack what situnitx is doing, I'm afraid.
Technically speaking the micro sign should be coming from the text font, and should never involve switching to the maths font(s). I would have thought that \char"00B5
would be the best option for this?
If you do use that value, it all seems to work, so maybe the hardcoded value of "03BC
that siunitx uses when unicode-math is loaded is not the best approach any more. @josephwright ?
\documentclass{article}
\usepackage{unicode-math}
\usepackage{siunitx}
\begin{document}
\ExplSyntaxOn
\cs_undefine:N \c__siunitx_micro_int
\int_const:Nn \c__siunitx_micro_int {"00B5}
\ExplSyntaxOff
[\SIUnitSymbolMicro] [$\text{\SIUnitSymbolMicro}$]
$\si{\micro m}$
\end{document}
In TL 16 (unicode-math 2017/01/27 v0.8d ) the following document outputs three upright mu. In Tl 17 ({2018/01/13} {v0.8k}) only the last mu is output. In the log there are three missing character messages:
(This is a problem for siunitx: https://tex.stackexchange.com/questions/411558/siunitx-abbreviations-are-not-printed-with-mathtools-fontspec-and-unicode-math).