9

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".

4
  • 4
    You could always make a new unit, \DeclareSIUnit{\bits}{bits}. Commented Aug 28, 2016 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
    Commented Aug 28, 2016 at 20:07
  • 7
    Units in the argument to \SI are symbols and should not take a plural. In your case you should simply type $20$~bits
    – egreg
    Commented Aug 28, 2016 at 20:26
  • 3
    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'
    Commented Aug 28, 2016 at 20:34

1 Answer 1

12

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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .