[Tex/LaTex] Typesetting the “spectral voltage noise density” unit “volt/sqrt(hertz)” with siunix

siunitx

How do I typeset the "spectral voltage noise density" unit "volt/sqrt(hertz)" with siunitx?

My naive (and unsuccessful) approach was:

\SI{100}[per-mode=symbol]{\nano\volt\per\sqrt{\hertz}}

Best Answer

siunitx sets units in text mode, so you have to ensure to be in math mode (thanks egreg and Joseph) for the root and then switch back to text for the unit. Not that complicated if you define a new unit and use it afterwards.

\documentclass{article}
\usepackage{siunitx}
\DeclareSIUnit{\sqrthz}{\ensuremath{\sqrt{\text{\hertz}}}}
\DeclareSIUnit{\voltnoise}{\volt\per\sqrthz}
\begin{document}
\SI[per-mode=symbol]{100}{\nano\voltnoise}
\[ \SI{3.5}{\mega\voltnoise} \sqrt{7} \]
\end{document}