[Tex/LaTex] Print \frac{4}{3} m/s using the SI unit package

siunitx

How do I print \frac{4}{3} m/s using the siunitx package?

$\SI{\frac{4}{3}}{m/s}$ gives an error.

Best Answer

SIunitx can output fractions if you (1) tell it to do this, and (2) write down input as a/b:

\documentclass{minimal}
\usepackage{siunitx}
\begin{document}
\sisetup{quotient-mode=fraction} % Output a/b as \frac{a}{b}
\SI{3/4}{\meter/\second}
\end{document}

enter image description here

You can set the quotient mode on a case by case basis:

\SI[quotient-mode=fraction]{3/4}{\meter/\second}

or change the fraction macro:

\SI[quotient-mode=fraction, fraction-function=\dfrac]{3/4}{\meter/\second} 
% Need amsmath for \dfrac
Related Question