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:

\SI{.23e7}{\candela}

The “e7” results in the exponent 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:

\SI[parse-numbers=false]{\sqrt{3}}{\metre}

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

### Like this:

Like Loading...