[Tex/LaTex] Is mixed per-mode possible in SIunitx

siunitx

In spectroscopy, frequency is often expressed as wavenumbers, which are reciprocal centimeters (I have \DeclareSIUnit\wn{\per\cm} in my standard preamble). I would like to show the shift in frequency of a laser as a function of temperature, whose units should look like cm$^{-1}$/K but always either comes out /cm/K or cm$^{-1}$ K$^{-1}$. While I realize that all are technically mathematically correct (which is the best kind of correct), it is less ambiguous and customary in the field to distinguish between wavenumbers as a frequency and inverse length by writing the units as in the first case.

Is it possible to tell SIunitx, perhaps as part of the declare unit command, that the exponent should be treated as part of the unit always, even if the per-mode is changed?

Best Answer

Define \wn slightly different using siunitx' \tothe or \raiseto:

\DeclareSIUnit\wn{\raiseto{-1}\cm}

or

\DeclareSIUnit\wn{\cm\tothe{-1}}

A complete example:

\documentclass{article}
\usepackage{siunitx}

\DeclareSIUnit\wn{\cm\tothe{-1}}
\sisetup{per-mode=symbol}
\begin{document}

\si{\wn\per\kelvin}

\end{document}

enter image description here