TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there something special that needs to be done to overwrite a binary prefix using the siunitx package? Overriding the SI prefixes is no problem. The MWE with \sisetup{binary-units=true} yields:

enter image description here

but with \sisetup{binary-units=false} I obtain:

enter image description here

Note that I was able to easily redefine \kilo, but am unable to redefine \bit:

Reference:

MWE:

\documentclass{article}
\usepackage{siunitx}
\usepackage{xcolor}

%% http://tex.stackexchange.com/questions/88848/how-do-i-typeset-units-like-mb-gb-megabytes-gigabytes
\sisetup{binary-units=true}%  

\DeclareSIUnit\bit{\textcolor{red}{bit}}%
\DeclareSIUnit\kilo{\textcolor{red}{k}}%

\begin{document}
    \si{\bit}
    \si{\kilo}
\end{document}
share|improve this question
up vote 6 down vote accepted

As the units here are optionally loaded, and as there is a need to allow compatibility with v1, the actual loading is done at the start of the document. Thus you need

\documentclass{article}
\usepackage{siunitx}
\usepackage{xcolor}


\sisetup{binary-units=true}%  
\AtBeginDocument{
  \DeclareSIUnit\bit{\textcolor{red}{bit}}%
  \DeclareSIUnit\kilo{\textcolor{red}{k}}%
}
\begin{document}
    \si{\bit}
    \si{\kilo}
\end{document}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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