6

With the input

[ n=CV = \SI{3.29e-3}{\micro\mol\per\L} \times \SI{8e-4}{L} = \SI{2.63}{\micro\mol} \]

I get output

enter image description here

As you see the spacing is not quite right - I really want the spacing of the scientific notation to be tighter, the terms 8 \times 10^-6 grouped together so it maintains its distinctness.

Edit: I noticed an arithmetic error; I left out e-06 on the RHS of the equation, but that's beside the point! :P

@aghsmith + @ Joseph Wright: Current accepted solution (2) compared with original (1).
enter image description here

It may be as good as it gets but I still have reservations about reading a page full of these kinds of scientific notations mixed with operators, numbers and units. The different terms meld into each other and it is difficult to discern discrete terms. Aghsmith's solution offers an improvement, but I can't help thinking more could be done with the spacing.

Solution accepted but still open to further suggestions for improvements, assuming I don't have the luxury of omitting or units or using dots for multiplication signs. I have thought about using \quad to increase the spacing between terms but that is too much manual effort...

  • 2
    instead of the second \times, try \cdot which gives a small dot. – Tom Bombadil Sep 7 '11 at 9:41
  • 1
    Personally, I'd add brackets in this case, or more usually omit the units in the calculations. – Joseph Wright Sep 7 '11 at 9:41
  • @ Tom Bombadil: The Tom Bombadil of Tolkien LoTR fame? Using a mix of dots and crosses is a great idea. – ptrcao Sep 7 '11 at 10:43
  • @Joseph Wright: Brackets might have to suffice. :) I'm not allowed to leave out the units unfortunately. :P – ptrcao Sep 7 '11 at 11:02
  • @ptrcao. siunitx is meant for typesetting units - the request looks more like a calculation, which is unsurprisingly more awkward to handle. In many ways, this is a question more of style than of code. – Joseph Wright Sep 7 '11 at 11:07
9

Use the tight-spacing=true option:

 \documentclass{article}
 \usepackage{amsmath}
 \usepackage{siunitx}


 \begin{document}

 \[ n=CV = \SI[tight-spacing=true]{3.29e-3}{\micro\mol\per\L} \times \SI[tight-spacing=true]{8e-4}{L} = \SI[tight-spacing=true]{2.63}{\micro\mol} \]


 \end{document}

or you can put that in the package options, or options just for the local environment:

  \sisetup{tight-spacing=true}
1

If you are unable to use a different symbol than \times to represent multiplication, you should consider using scientific E or e notation (I think little e is easier to read):

Example LaTeX render of different siunitx exponential notation styles

To enable this you can set output-exponent-marker = \ensuremath{\mathrm{E}} or output-exponent-marker = \text{e} if you prefer big E or little e notation respectively, either inline as @aghsmith suggested:

\[ n=CV = \SI[output-exponent-marker=\text{e}]{3.29e-3}{\micro\mol\per\L} \times \SI[output-exponent-marker=\text{e}]{8e-4}{L} = \SI[output-exponent-marker=\text{e}]{2.63}{\micro\mol} \]

globally when calling \usepackage{}:

\usepackage[output-exponent-marker=\text{e}]{siunitx}

or with \sisetup either in the preamble or prior to the use of \SI:

\sisetup{output-exponent-marker=\text{e}}

You can also temporarily set it by using curly brackets around \sisetup and the wherever you want \sisetup to have effect, as I have done with the code to generate the image above:

\begin{align}
n=CV = \SI{3.29e-3}{\micro\mol\per\L} \times \SI{8e-4}{L} = \SI{2.63}{\micro\mol}\\
{
\sisetup{tight-spacing=true}
n=CV = \SI{3.29e-3}{\micro\mol\per\L} \times \SI{8e-4}{L} = \SI{2.63}{\micro\mol}
}\\
{
\sisetup{output-exponent-marker=\ensuremath{\mathrm{E}}}
n=CV = \SI{3.29e-3}{\micro\mol\per\L} \times \SI{8e-4}{L} = \SI{2.63}{\micro\mol}
}\\
{
\sisetup{output-exponent-marker=\text{e}}
n=CV = \SI{3.29e-3}{\micro\mol\per\L} \times \SI{8e-4}{L} = \SI{2.63}{\micro\mol}
}
\end{align}

Note that output-exponent-marker is documented on page 29 of the current pdf manual.

0

For anyone looking for a simpler way to typeset scientific notation, just use math mode and a thinspace:

\documentclass{article}
\begin{document}

8\thinspace$\times$\thinspace$10^{-4}$ L

\end{document}

This gives almost exactly the same result as using the SI package. In the picture below, the top number is from using \SI{8e-4}{L}, the bottom number is using the code above:

enter image description here

  • In what way is this simpler than \SI{8e-4}{L}? – egreg Jan 8 '15 at 13:44
  • 1
    It is simpler in that it does not require a package and can be used when there is no unit. – madroan Jan 8 '15 at 14:57
  • Why not $8\times10^{-4}$\,L? – Torbjørn T. Sep 29 '15 at 20:04
  • For what it's worth, \num{8e-4} from siunitx can be used when there is no unit. – JulianHzg Dec 18 '17 at 19:26

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.