# SI units for sheet resistance using siunitx

I'm trying to get the package siunitx to output the units for sheet resistance (Ohm per square), with the square as a square box. My current solution (in text mode) is:

30-60 $\Omega/\square$


Which works, but I prefer to have it rendered using the \SI command, for code consistency. My closest approach within the SIunitx commands is

\SIrange{30}{60}{\Ohm/sq}


This doesn't output the box, but rather the letters sq. Simply using \square fails, since that is already defined as longhand for ^2. Is there any way to output the square symbol within SIunitx?

-

Following works:

\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\DeclareSIUnit\sq{\ensuremath{\Box}}
\begin{document}
\SIrange{30}{60}{\ohm\per\sq}
\end{document}


You can also customize the way in which the range is written using range-phrase = -- and range-units=single as in this code sample:

\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{siunitx}
\sisetup{per-mode=symbol}
\DeclareSIUnit\sq{\ensuremath\Box}
\begin{document}
\SIrange{30}{60}{\ohm\per\sq}

\SIrange[range-phrase = --,range-units=single]{30}{60}{\ohm\per\sq}

\SIrange[range-phrase = --,range-units=brackets]{30}{60}{\ohm\per\sq}

\end{document}


-
Thanks, this works perfectly! –  Frans Sep 12 '12 at 0:44
I'd use \ensuremath in the definition, for safety –  Joseph Wright Sep 12 '12 at 6:28
@JosephWright: As you say, done. Thank you. –  Harish Kumar Sep 12 '12 at 12:35