The siunitx package has a special macro for setting angles in degrees called like \ang{42}
, which renders as , i.e. sets no space between the number and the unit as recommended and in contrast to the normal \unit
, which inserts a thin space. Unfortunately the \ang
macro has no optional argument adding additional units (as in \ang{42}[\per\second]
), which leads to the following question:
Having an angular velocity in degree (unit: degree per seconds; I do not want to use rad/s here), what is the recommended way to have a nice (correct) output and what is the recommended way with siunitx?
I have two suggestions:
First
\SI{42}{\degree\per\second}
resulting in and second
\num{42}\si{\degree\per\second}
which looks like . Both look unfamiliar, but the output of the latter might look a bit more familiar than the first one, altough the code of the former is nicer than that of the second one.
Does anyone know what is officially correct?
Best Answer
One possibility to keep being flexible would be to redefine
\ang
with an xparse argument signature like the following{omo}
to add the optional unit in the third argument. This macro then could easily be redefined.Unfortunately this would either include a call to
\SI
and thus loosing the possibilities of anglular minutes and angular seconds of the original\ang
macro or include a call to the old\ang
macro. The latter is to my knowledge not possible without code duplication, as neither the\let
nor the\LetLtxMacro
commands can cope with macros defined by xparse (which is the case for\ang
defined in siunitx).As a workaround it is possible to use the following definition until there is a better solution:
Then it is possible to write
or
and add spacing as
\,
to the macro definition later, if that should be needed.Update:
I contacted Joseph Wright (siunitx package author) and he proposes
according to the NIST standard:
So that's the way to go, which can be achieved by