2

I know there is a command like \degreeCelsius in siunitx. But I do not know how to define something like \degreeKelvin (in a title like this). using \qty{300}{\degree\Kelvin} will add too many spaces.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Ryan
  • 135
  • 5
    There's no Degree Kelvin, there's only Kelvin. At least since 1967. That said, \DeclareSIUnit{\degreeKelvin}{\ensuremath{{}^\circ}K} could be a start. – Qrrbrbirlbel Aug 23 '23 at 01:22
  • @Qrrbrbirlbel I agree. But the paper I cited (1978) used °K. – Ryan Aug 23 '23 at 01:51
  • If you want to print °K then write °K or define \def\degreeKelvin{°K} and write \degreeKelvin. – wipet Aug 23 '23 at 06:51

1 Answers1

4

The general case of declaring a new unit is covered by Defining new unit (year, century) in siunitx. Here, the degree symbol is slightly tricky. Assuming you are not using unicode-math then a definition that matches that for \degreeCelsius would be

\DeclareSIUnit \degreekelvin
  {\ifmmode{}^{\circ}\else\textdegree\fi K}

(Other than Celsius, unit names are not capitalised.)

If you are loading unicode-math, then

\DeclareSIUnit\degreekelvin{°K}

should work.

However, for a 'one off' case like this, I'd be tempted just to use literal unit input

\qty{300}{{}^{\circ} K}

(or similar): you don't need all of the unit processing, you can be sure of math vs text mode, etc.

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
  • Thank you, I have unicode-math loaded, and it works for me! BTW, your answer has an extra three backticks. – Ryan Aug 23 '23 at 05:55