[Tex/LaTex] How to write hyphen between number and unit in an attribute (30-s acquisition) with siunitx

siunitx

I think the title says it all. I browsed through the whole manual of siunitx, but I could not find an option allowing to write

30-s acquisition

with a single \SI... command (I could of course use a macro, but I guess this is not the point). I only found

\num{30}-\si{\second}

Did I miss something?

Best Answer

I do not advocate this at all, but if you must do it, I would propose a new command, \SIadj, for easy usage of both forms as needed:

\documentclass{article}
\usepackage{siunitx}
\newcommand{\SIadj}[2]{\SI[number-unit-product={\text{-}}]{#1}{#2}}

\begin{document}
$\SI{30}{\second}$ $\SIadj{30}{\second}$

\SI{30}{\second} \SIadj{30}{\second}
\end{document}

enter image description here

Related Question