It is possible to re-declare/redefine existing siunitx units in general. However, this seems to fail for the binary units \bit
(and \byte
) as shown in the MWE below.
Only if the declaration is done after the preamble via \AtBeginDocument
the declaration works.
\documentclass{article}
\usepackage[
binary-units,
]{siunitx}
% \AtBeginDocument{
\DeclareSIUnit\bit{b}
% }
\begin{document}
\SI{8}{\bit}
\end{document}
Why is this the case? Is this a bug? Why is \bit
defined as bit
in the first place while \byte
is simply B
? This produces rather unreadable output with IEC prefixes like Gibit.
I am using version 2.7a (2017-01-01) from TexLive 2016.
Best Answer
The time of loading is certainly intentional. The
binary-units
option code (for true) is:which as the code suggests, does basically
\AtBeginDocument{\input{siunitx-binary.cfg}}
(with a little more work to have the file be loaded as a package).It isn't clear why this is loaded
\AtBeginDocument
and not at the time of loadingsiunitx
(I didn't find any hint in the source, at least). But there's this:but it doesn't say what changed...
Only Joseph knows :-)
As for the representation of
\bit
, the SI brochure, which is used as reference forsiunitx
, doesn't say anything about digital storage units, so it's probably down to what you said:so it's basically a matter of choice between the two. Although I think that in written text
8 bit
is clearer than8 b
, the former becomes weird when combined with prefixes/other units, so it's a tough pick...