[Tex/LaTex] siunitx: per-mode=fraction set globally has no effect

siunitx

So I'm trying to have my units in a nice fraction. I want to set per-mode=fraction globally via \sisetup{}. However it just doesn't do anything.

Here's a snippet (with my full preamble, in case there is any conflict that causes this):

\documentclass[11pt,
paper=a4,                   
footinclude,
oneside
]{scrbook}
\usepackage{mathtools}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[european]{circuitikz}
\usepackage{float}
\usepackage{pgfplots}
\usepackage{amssymb}
\usepackage{siunitx}

\sisetup{exponent-product = \cdot, output-decimal-marker = {,}, per-mode = fraction}

\XeTeXinputencoding latin-1

\begin{document}

... much stuff

\begin{equation}
  U_T = \frac{k_B T}{e} \;  \xrightarrow{T=300K} \;  \frac{\SI{1,38e-25}{Vs \per K} \cdot \SI{300}{K}}{\SI{1,609e-19}{C}} = \SI{26}{mV}\;.
\end{equation}

Dabei ist $k_B$ die Boltzmann-Konstante und $e$ der Betrag der Elektronenladung. Für typische Werte gilt:

\begin{equation}
  U_D = \SI{26}{mV} \cdot ln \left( \frac{\SI{e16}{1 \per cm^3} \cdot \SI{2e16}{1 \per cm^3}}{\left( \SI{e10}{1 \per m^3} \right)^2} \right) = \SI{0,715}{V}
\end{equation}

...even more stuff

\end{document}

Using xelatex.

Best Answer

I guess this feature requires the usage of defined units instead of just text input. Compare the following two expressions:

\documentclass[11pt,
paper=a4,                   
footinclude,
oneside
]{scrbook}
\usepackage{mathtools}
\usepackage[ngerman]{babel}
\usepackage{graphicx}
\usepackage{caption}
\usepackage[european]{circuitikz}
\usepackage{float}
\usepackage{pgfplots}
\usepackage{amssymb}
\usepackage{siunitx}
\sisetup{exponent-product = \cdot, output-decimal-marker = {,}, per-mode = fraction}

\begin{document}


    $\SI{1}{\per cm^3}$
    $\SI{1}{\per\centi\meter\cubed}$

\end{document}

enter image description here


EDIT:

As Steven B. Segletes mentioned in his comment it might be a good idea to combine this with the option fraction-function=\dfrac in order to make those display style.