[Tex/LaTex] Siunitx Won’t Display Reciprocal Powers

siunitxunits

I have several SI units in my document which I would like to typeset using the siunitx package. According to the documentation the default mode for the \per command is 'reciprocal' meaning \si{m\per s} should produce output akin to ms$^{-1}$ but on my system it is producing m/s.

I have tried setting \sisetup{per=reciprocal} and \sisetup{per-mode=reciprocal} but it seems to ignore this and continues to use '/'.

Specifying the mode for individual units works but I don't want to have to type [per-mode=reciprocal] every time I want to typeset a unit.

Am I missing something or is there a way to fix this (preferably without \newcommand)?

Best Answer

The 'unit parser' in siunitx only operates on 'symbolic' units such as

\si{\m\per\s}
\si{\metre\per\second}

where the behaviour of \per is selectable. For the 'literal' input

\si{m\per s}

parsing is not possible ('literal' input could be anything), and instead \per switches to simply inserting a /. Thus while the 'interpreted' mode requires slightly more typing, as it is more 'programmable' it's the recommended approach.