TransWikia.com

How to make the "reciprocal power" appear using siunitx?

TeX - LaTeX Asked by Sébastien Mengin on March 8, 2021

Using the following MWE, siunitx won’t display the expected ^{-1} at the end of the expression.

documentclass{article}
usepackage[locale = FR]{siunitx}
sisetup{per-mode=symbol,per-symbol=text{.}}

usepackage[french]{babel}

begin{document}
si{kilogrammetrepersecond}
end{document}

I think I’m following the documentation correctly but I must be missing something.
Any input very welcome.

Thanks !

One Answer

If what you're looking to get is kg m s^{-1} out of si{kilogrammetrepersecond}, you should not use sisetup{per-mode=symbol,per-symbol=text{.}}. The default per-mode setting is, actually, reciprocal. If the default setting isn't in force for some reason, just issue the directive

sisetup{per-mode=reciprocal}

before running, say, si{metrepersecond} (or, if you prefer, si{meterpersecond}).

enter image description here

documentclass{article}
usepackage[locale = FR]{siunitx}
usepackage[french]{babel}

begin{document}
si{metrepersecond}    % use default setting, which is 'reciprocal'
quad
sisetup{per-mode=symbol} % default per-mode symbol is "/"
si{metrepersecond}
quad
sisetup{per-mode=symbol,per-symbol=text{.}} % use another character as per-mode symbol
si{metrepersecond}
quad
sisetup{per-mode=fraction}   % switch to fraction mode
si{metrepersecond}
quad
sisetup{per-mode=reciprocal} % back to the default
si{metrepersecond}
end{document}

Addendum, prompted by a follow-up comment by the OP: If interest lies in rendering the output of si{metrepersecond} as m.s{-1}, the per-mode option is not relevant. Instead, you probably want

sisetup{inter-unit-product=text{.}}

enter image description here

documentclass{article}
usepackage[locale = FR]{siunitx}
usepackage[french]{babel}
begin{document}
si{meterpersecond} % default inter-unit separator is thin-space
quad
sisetup{inter-unit-product=text{.}}
si{meterpersecond}
quad
sisetup{inter-unit-product={,}} % back to default
si{meterpersecond}
end{document}

Correct answer by Mico on March 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP