# Automatic per-mode switch from symbol to reciprocal

Is there a way to make the siunitx package output a unit with a single slash using per-mode=symbol and fallback to per-mode=reciprocal when there is more than one slash?

\documentclass{article}
\usepackage{siunitx}

\begin{document}
\SI{1}{\metre\per\second}            % would output 1 m/s
\SI{1}{\ampere\per\metre\per\second} % would output 1 A m-1 s-1
\end{document}

• Welcome to TeX.SX! You can set the options for each command when you use it: \SI[per-mode=symbol]{1}{\meter\per\second}... I don't know an automatic way :-) Jun 9, 2014 at 21:25
• Welcome to TeX.SX! You got +1 from me for a perfect MWE :)
– yo'
Jun 9, 2014 at 21:30
• My question is quite similar to the second part of this one. I opened a new enhancement request on github.com/josephwright/siunitx. Jun 10, 2014 at 11:10

## 1 Answer

Not very automatic, but helpful if you have to write it many times. You can define a new unit like

\DeclareSIUnit\Ms{m/s}


and use it like

\SI{1}{\Ms}


whenever you need.

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit\Ms{m/s}
%\sisetup{per-mode=symbol}

\begin{document}
\SI{1}{\metre\per\second}

\SI{1}{\Ms}            % would output 1 m/s

\SI{1}{\ampere\per\metre\per\second} % would output 1 A m-1 s-1
\end{document}


But if you have other instances of such cases, you have to define one for each of them.