5

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{\kilogram\metre\per\second}
\end{document}

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

Thanks !

1
  • Welcome to TeX.SE.
    – Mico
    Oct 13, 2020 at 16:11

1 Answer 1

8

If what you're looking to get is kg m s^{-1} out of \si{\kilogram\metre\per\second}, 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{\metre\per\second} (or, if you prefer, \si{\meter\per\second}).

enter image description here

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

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

Addendum, prompted by a follow-up comment by the OP: If interest lies in rendering the output of \si{\metre\per\second} 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{\meter\per\second} % default inter-unit separator is thin-space
\quad
\sisetup{inter-unit-product=\text{.}}
\si{\meter\per\second}
\quad
\sisetup{inter-unit-product={\,}} % back to default
\si{\meter\per\second}
\end{document}
3
  • 1
    Thanks for your clear answer. The thing is, we would like to obtain m.s^{-1}... a mix of your third and fifth example. Oct 13, 2020 at 17:03
  • @SébastienMengin - What you need, then, is \sisetup{inter-unit-product=\text{.}}, not \sisetup{per-mode=symbol,per-symbol=\text{.}}.
    – Mico
    Oct 13, 2020 at 17:23
  • 1
    Many thanks ! this is exactly what I was looking for. Oct 13, 2020 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .