6

In recent versions of siunitx the macros \si{\micro} and \SI{0.550}{\micro\m} do not work with the package fontspec.

Here is the MWE:

\documentclass[12pt]{article}

\usepackage{fontspec}
\usepackage{siunitx}

\begin{document}
wavelength $\lambda =$ \SI{0.550}{\micro\m}\\

wavelength $\lambda = \SI{0.550}{\micro\m}$\\

It should be wavelength $\lambda =  0.550 \,\mu \text{m}$.

\end{document}  

Do I have to set any option in siunitx or fontspec?

3
  • And what fonts are stating in the preamble to use with fontspec?
    – Aradnix
    Commented Oct 1, 2014 at 5:47
  • 1
    Good title of this thread: macro micro :).
    – wipet
    Commented Oct 1, 2014 at 7:43
  • expecting two members of the LaTeX3 team to make their packages work together, amazing optimism:-) Commented Oct 1, 2014 at 11:26

1 Answer 1

8

This is an issue introduced in v2.6a to try to improve font coverage for some package combinations. For the present, use

\ExplSyntaxOn
\AtBeginDocument {
  \cs_undefine:N \c__siunitx_micro_int
  \int_const:Nn \c__siunitx_micro_int { "000B5 }
}
\ExplSyntaxOff

A fix will be sent to CTAN today.

12
  • @PeterGrill Sorted!
    – Joseph Wright
    Commented Oct 1, 2014 at 6:38
  • Adding the suggested code shows the mu letter but it also removes all space between words.
    – user56595
    Commented Oct 1, 2014 at 6:40
  • 2
    @user56595 I've revised the internals slightly to try to cover better the 'common cases' for fontspec/unicode-math. I can test if a package is loaded but not what options are set: the docs do say that particularly with the modern engines you might need to adjust things in terms of the symbols. It's not possible to detect every font set up, I'm afraid, so I have to try to pick what seems most likely. I'll see if I can work out a few more combinations automatically.
    – Joseph Wright
    Commented Oct 1, 2014 at 7:05
  • 1
    @user56595 For v2.6 I've switched the standard setting to typeset the unit part of a quantity in math mode, which is much as you'd do by hand: \mathrm{m}\,\mathrm{s}^{-1} and so on. However, when you have no-math with fontspec you don't get the 'engine native' symbols as you do with the standard settings. So you'll need \sisetup{unit-mode = text} for that case.
    – Joseph Wright
    Commented Oct 1, 2014 at 7:11
  • 1
    @Dirk I've just checked this with the latest release (v2.6c) and with the example as given in the question all is fine. If it's not working, please e-mail me a demo.
    – Joseph Wright
    Commented Oct 9, 2014 at 12:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .