siunitx \celsius 字体

siunitx \celsius 字体

我正在编写实验室手册并用它\renewcommand{\familydefault}{\sfdefault}来设置字体。

但是,使用siunitx\celsius单位时不会更改字体。所有其他单位(我迄今为止使用过的)都使用正确的字体,而\celsius似乎是cmr

平均能量损失

\documentclass{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{siunitx}
\AtBeginDocument{\sisetup{math-rm=\mathsf, text-rm=\sffamily}}
\newcommand{\cc}{\cm\cubed}
\sisetup{range-phrase= --}
\begin{document}

\SI{250}{\cc} of solution were refluxed at \SI{73}{\celsius}.
A \SI{20}{\cc} aliquot of a solution of acetic acid was titrated against a standardised solution of NaOH (\SI{0.48}{\mole\per\deci\metre\cubed}. An average titre of \SI{15.3}{\cc} was required.  

A solution was distilled ensuring only the fraction boiling from \SIrange{56}{58}{\celsius} was collected.

The fraction boiling in the range \SIrange{56}{58}{\degreeCelsius} was collected.%just to see if \degreeCelsius produces a different output to \celsius

\end{document}

我尝试了以下解决方案我可以让 siunitx 命令像 beamer 中的其他数学一样使用衬线字体吗?如 MWE 的第 4 行所示,但是不起作用。

我也尝试了 Qrrbrbirlbel 在评论中的这个建议(根据我的需求进行调整)更改 siunitx 中单位的字体(效果与上面相同。)

由于我的其他单元选择了正确的字体,这仅仅是一个错误吗?

或者这是的标准\celsius

答案1

在 v3 中siunitx,打印控制会更加努力地与您手动输入的内容保持一致。因此,我们在这里要设置text-family-to-math将文本系列 ( sf) 传播到数学模式。这将使用更新的标准设置自动处理度数符号:

\documentclass{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{siunitx}
\sisetup{text-family-to-math}
\begin{document}
The fraction boiling in the range \qtyrange{56}{58}{\degreeCelsius} was collected.
\end{document}

v2 的旧答案:

math-celsius正如 Ulrike 所评论的那样,这里似乎需要进行更改

\sisetup{math-celsius = {}^{\circ}\kern-\scriptspace C}

我认为总体来说这比当前的定义更好:我可能会改变标准设置。

相关内容