7

I need to express things like (longhand) 'this fullword contains the elapsed time in units of 1048576 microseconds'.

I would imagine something like '... units of µs × 2²° ...' (horrid superscript, I know) might be an adequate shorthand, and thought of siunitx:

\documentclass{article}
\usepackage[%
    binary-units=true,
    prefixes-as-symbols=false,
    ]{siunitx}
\begin{document}
%In units of \si{\mebi\micro\second}. % <= Fails

In units of \si{\mebi\bit}.

In units of \si{\mebi\second}.

In units of \SI{1}{\mebi\second}
\end{document}

It appears that siunitx, reasonably, won't let me mix prefixes:

! siunitx error: "prefix-base-mismatch"
! 
! Prefix bases do not match.

Can anyone suggest an adequate notation, and how I might achieve it in siunitx?

6
  • 4
    What's wrong with 'in units of \SI[parse-numbers = false]{2^{20}}{\micro\second}'?
    – Joseph Wright
    Jun 11, 2012 at 16:18
  • 1
    How about \DeclareSIUnit{\microsecond}{\ensuremath{\mu}s} \si{\mebi\microsecond}?
    – Jake
    Jun 11, 2012 at 16:29
  • @JosephWright: Nothing. An excellent suggestion! Jun 11, 2012 at 16:43
  • @Jake: I like that slightly better than Joseph's, as it gives me the flexibility of producing 'Miµs' (as in mimsy). If you'd like to make that an answer, it's got a good chance. After Joseph has had another opportunity to comment. Jun 11, 2012 at 16:46
  • 4
    @Jake That will use the wrong symbol for micro (italic rather than upright by default). If you want to go this way, use \SIUnitSymbolMicro rather than \ensuremath{\mu}.
    – Joseph Wright
    Jun 11, 2012 at 17:09

1 Answer 1

6

You can use

\DeclareSIUnit{\microsecond}{\SIUnitSymbolMicro s} \si{\mebi\microsecond}

which allows you to type

In units of \si{\mebi\microsecond}.

to get

2

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.