# siunitx: per-mode=fraction set globally has no effect

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

$$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}\;.$$

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

$$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}$$

...even more stuff

\end{document}


Using xelatex.

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}


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.

• You might also alert the readers to the option fraction-function=\dfrac in order to make those display style. Jul 11 '16 at 18:06
• @StevenB.Segletes Like this? Please feel free to edit if your intention was something different. Jul 11 '16 at 19:43
• The $\SI{1}{\per\centi\meter\cubed}$ style solution perfectly solved my problem. I'm still contemplating whether I want to have the fraction-function=\dfrac feature, but still thanks for the input. Sometimes you just have to understand how the system works to make it run. :) Jul 11 '16 at 20:08