New siunitx font specifications

fontssans-serifsiunitx

For personal reasons, I like when my paper is written in sans font while my math and units are written in serif. I recently updated to version 3 of the siunitx package and have no idea of how to reset the unit font to serif.

The command I use to set the default font is

    \renewcommand{\familydefault}{\sfdefault}

Here's my MWE:

\documentclass[12pt]{article}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{siunitx}
    \sisetup{mode = math, reset-text-family = true  }
\begin{document}

\qty{15}{mm}

\end{document}

And here's my output.enter image description here

Whilst my desired output is: enter image description here

Thank you.

Best Answer

You need to reverse an automatic setting change here:

\documentclass{article}
\usepackage{siunitx}
\renewcommand{\familydefault}{\sfdefault}
\AtBeginDocument{\sisetup{unit-font-command = \mathrm}}
\begin{document}
\qty{15}{mm}
\end{document}