[Tex/LaTex] Unwanted behaviour of siunitx

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

Output

Question

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

Best Answer

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}

enter image description here

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.

Related Question