2

I use babel to write documents in my native language Hebrew. I also use the siunitx package to format numbers and units. I use custom fonts for Hebrew and English (for Hebrew since I need a font that supports the language, and for English simply because of style preferences). It seems that using the \micro command or any other command involving the mu symbol uses the Hebrew font I selected which doesn't have a mu symbol:

\documentclass{article}

\usepackage{siunitx}
\usepackage{upgreek}

\PassOptionsToPackage{no-math}{fontspec}

\usepackage[bidi=basic, layout=tabular]{babel}

\babelprovide[main, import, alph=letters, Alph=letters]{hebrew}
\babelprovide[import]{english}

% Font setup
\babelfont{rm}{TeX Gyre Bonum}
\babelfont{sf}{TeX Gyre Adventor}

\babelfont[hebrew]{rm}[Renderer=HarfBuzz]{David CLM}
\babelfont[hebrew]{sf}[Renderer=HarfBuzz]{Miriam CLM}
\babelfont[hebrew]{tt}[Renderer=HarfBuzz]{Miriam Mono CLM}

\babelfont{david}[Renderer=HarfBuzz]{David CLM}

\sisetup{
    group-separator = {,},
    group-digits=integer,
    uncertainty-mode=separate,
}

\begin{document}
\[ \SI{5}{\micro\meter} \]
\end{document}

This code produces

Which is wrong. If I use \selectlanguage{english} to switch to English, it uses the custom English font, which has a mu symbol, but it's different than the normal font which makes it look weird when combined with other symbols like micrometer:

How can I make siunitx use the default math font for the micro symbol? I tried to use the options math-micro and text-micro to change the symbol, but it seems these options no longer exist in siunitx.

1 Answer 1

4

In v3, the standard setting for \micro uses \textmu for 8-bit engines and the literal character μ in text mode for Unicode engines: this is the safest choice in most cases. However, it's impossible to predict all font combinations, particularly with system font use. In the current case, neither \textmu nor the literal character is set up for the font in use. You will therefore need to re-define \micro to use whatever symbol you feel is most appropriate: by the look of things

\DeclareSIPrefix\micro{\ensuremath{\upmu}}{-6}
1
  • Interesting. I will try this later. However, the examples I provided use display math mode (\[ … /]). So why doesn’t it work properly there?
    – Shai Avr
    Sep 14, 2023 at 9:50

You must log in to answer this question.

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