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


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:

\sisetup{quotient-mode=fraction} % Output a/b as \frac{a}{b}

enter image description here

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


or change the fraction macro:

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