3

There have been some changes to siunitx recently and one of them is the typesetting of units. The change is most noticeable in degrees Celsius.

In the new version, the degree symbol no longer scales well with the rest of the text. You can see this in the following example.

\usepackage{siunitx}

\begin{document}
\SI{15}{\celsius}{\tiny\SI{15}{\celsius}}
\end{document}

enter image description here

Is this a bug or am I doing something wrong?

PS: very important: if you decide to redefine \celsius as suggested in the answer, do not forget to redefine \degree as well for consistency:

\DeclareSIUnit[quantity-product = ]\degree{\text{\textdegree}}
2
  • BTW, by 'new' I assume you mean v3.x series, so from mid-2021 onward
    – Joseph Wright
    Feb 15 at 19:29
  • @JosephWright Quite possibly. I don't write a new book each year so it takes me some time to notice a difference :)
    – Pygmalion
    Feb 15 at 19:35

1 Answer 1

3

The standard settings in siunitx do their best to select something sensible based on a 'reference rendering'. Here, you are in math mode and have no Unicode math code loaded, so the reference for the degree symbol is {}^{\circ} If you try that in your demo, you'll find it comes out at the same size you have. You may prefer the text mode \textdegree or if appropriate direct use of ° (if you load unicode-math with a suitable font, for example).


In general terms, the approach expected by siunitx is that you make an appropriate font choice for your document and adjust the definitions as required to make that work.

The alternative approach is to is essentially to change the definition of the relevant unit. That seems to be the desired outcome here, using the text mode symbol (\textdegree) even in math mode, so

\DeclareSIUnit\degreeCelsius{\text{\textdegree}C}

would work.

(Depending on the font setup available, of course, it may be necessary to adjust both as siunitx may simply 'guess wrong' in terms of unit definitions.)

1

You must log in to answer this question.

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