8

Does siunitx (or any other unit package) have a way of showing plural units?

For example, \SI{1}{\bit} should (and does) render "1 bit".

But \SI{20}{\bit} should render "20 bits"; instead, it renders "20 bit".

I understand that this isn't always the default (for example, if you want to talk about a "32-bit operating system"), but is there an option that would enable this?

To support validity of this question I can give and example where IEEE in their 'Editorial Style Manual' require that "Plurals of units of measure take the “s.” For example, the plural form of 3 mil is 3 mils; 3 bits/s instead of 3 bit/s".

  • 3
    You could always make a new unit, \DeclareSIUnit{\bits}{bits}. – Torbjørn T. Aug 28 '16 at 20:05
  • 1
    @TorbjørnT. Didn't know that existed - seems as good an answer as any to me. Turn it into one so I can accept it please! – tonysdg Aug 28 '16 at 20:07
  • 6
    Units in the argument to \SI are symbols and should not take a plural. In your case you should simply type $20$~bits – egreg Aug 28 '16 at 20:26
  • 2
    Just to add to @egreg, note that you have: The length is $5$~metres. It's a $5$-metre cable. but The length is $5$\,m$. It's a $5$\,m cable. The long variants can't be expressed using siunitx, the short can. Now, the problem with bit is that it's a unit of measure whose shorthand is simply bit. – yo' Aug 28 '16 at 20:34
11

siunitx lets you define new units using

\DeclareSIUnit{<macro>}{<symbol>}

so you could make your own plural units, i.e.

\DeclareSIUnit{\bits}{bits}

\documentclass{article}
\usepackage{siunitx}
\sisetup{binary-units=true}
\DeclareSIUnit{\bits}{bits}
\begin{document}
\SI{1}{\kilo\bit} or \SI{1000}{\bits}.
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.