I would like to globally define the per-mode
of siunitx
for math environment and displaymath environment separately. Is this somehow possible?
Here is a MWE:
\documentclass{article}
\usepackage{amsmath}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\begin{document}
This is an inline equation: $a = \SI{10}{\meter\per\second\squared}$, to show inline behaviour.
And this is the same equation in displaymath environment:
\begin{equation*}
a = \SI{10}{\meter\per\second\squared}
\end{equation*}
\end{document}
This produces:
What I would love to do is something like this:
\documentclass{article}
\usepackage{amsmath}
\usepackage{siunitx}
\sisetup{per-mode-math=symbol,
per-mode-displaymath=fraction}
\begin{document}
This is an inline equation: $a = \SI{10}{\meter\per\second\squared}$, to show inline behaviour.
And this is the same equation in displaymath environment:
\begin{equation*}
a = \SI{10}{\meter\per\second\squared}
\end{equation*}
\end{document}
Which then should produce the following output:
Best Answer
As Joseph Wright pointed out: The solution here is to use
\sisetup{per-mode=symbol-or-fraction}
as described in thesiunitx
manual:So for a MWE:
Which works as expected: