Customising exponents in siunitx

Typesetting SI units in LaTeX can be done using the siunitx package.  One disadvantage is that siunitx doesn’t like math-mode inside the numbers it has to print. This makes it a little tricky to add unusual exponents or do other formatting that is easy in math-mode.  Therefore, siunitx includes a parser that figures out such things as \SI{5 x 2}{\metre} should appear as follows:


Another use is typesetting numbers with exponents, such as the following:


The “e7” results in the exponent latex_6ab6133230db0c62062503c6388e78a0 being included producing the following output:


What if you want a different exponent that has meaning in your specific field?  Fortunately, siunitx includes a method for you to define new exponents:

\SI[exponent-base=1024, input-exponent-markers=k]{5k2}{elements\per\second}

This produces the following:


I found this solution here.  The other solution is to disable the parser by using parse-numbers=false like in this example from the siunitx documentation:


This allows all math-mode commands to be used.  The resulting output is:



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s