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}}
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}
\sqrtinsiunitxin text without further stuff, unless one uses the optiondetect-mode(ordetect-allof course). Then the above seems to be a good workaround. – Skillmon Feb 03 '18 at 19:45siunitxv3 this does not work (\hertzundefined). I use\DeclareSIUnit{\sqrthz}{\ensuremath{\sqrt\mathrm{Hz}}}, but probably there is a smarter way. – Rmano Oct 24 '23 at 12:31\hertzbeforehand and use it then as done above. – Skillmon Oct 24 '23 at 12:32\hertzis defined, the problem is that it is not "seen" inside the\sqrt(sorry, I expressed myself badly) – Rmano Oct 24 '23 at 12:35\sqrt{\unit{\hertz}}(also, in your comment above the braces after the\sqrtare missing, it should be\sqrt{\mathrm{Hz}}). – Skillmon Oct 24 '23 at 13:16