# Unwanted behaviour of siunitx

Consider the following example.

Code

\documentclass{article}

\usepackage[per-mode=symbol-or-fraction]{siunitx}

\begin{document}
$\frac{x}{\SI{4}{\m\per\degree}}$
\end{document}


Output

Question

Why is the per-mode option set to symbol? Shouldn't it be fraction or am I missing something obvious?

See the difference bettween per-mode=fraction and per-mode=symbol.

\documentclass{article}

\usepackage{siunitx}
\begin{document}
$\frac{x}{\SI[per-mode=fraction]{4}{\m\per\degree}}$
$\frac{x}{\SI[per-mode=symbol]{4}{\m\per\degree}}$
$\textstyle \frac{x}{\SI[per-mode=symbol-or-fraction]{4}{\m\per\degree}}$
$\displaystyle \frac{x}{\SI[per-mode=symbol-or-fraction]{4}{\m\per\degree}}$
$\frac{x}{\SI[per-mode=symbol-or-fraction]{4}{\m\per\degree}}$
$\frac{x}{\displaystyle\SI[per-mode=symbol-or-fraction]{4}{\m\per\degree}}$
\end{document}


In fact, in the last two equations, \per should be printed as fraction, like the siunitx manual (bottom of p. 41) points out:

Setting per-mode to symbol-or-fraction will use the symbol setting for in line math, and the fraction setting when used in \displaystyle math.

There is probably a bug or an omission of some option.

• How is it a bug? The denominator of a displaystyle fraction is in textstyle by default, just see the output of \frac{1}{\sum_{i=1}^{n}{a_i}}. Apr 29, 2013 at 5:30
• @T.Verron Okay. I, as well, thought it was in \displaystyle math. Apr 29, 2013 at 5:49
• I'd say this is a subtly that should probably go into the manual: @T.Verron is correct that \textstyle is active at the point of choice (and I'd say this looks 'best'), but that might not be obvious to most people. Apr 29, 2013 at 6:06
• I edited my answer to add the \displaystyle in the denominator. As expected the visual result is not the same as using the per-mode=fraction. Apr 29, 2013 at 9:45