44

I want to use scientific notation with the siunitx package. However, when I try to do it I am getting an error:

The width of a human hair is \SI{1 \times 10^{-4}}{m}.

This has always given me a LaTeX Error" invalid character '10^{-4}' in numerical input

Is there a better way to do this while continuing to use siunitx?

Thanks!

6
  • Is it is output that's important here or the input?
    – Joseph Wright
    Aug 25, 2010 at 20:28
  • I'm not sure what your question means. I pulled the error string directly from the output generated from building the LaTeX document.
    – dtlussier
    Aug 25, 2010 at 20:51
  • I wonder if you need \SI{1 \times 10^{-4}}{m} to work in the input or only to get 1 \times 10^{-4} in the output.
    – Joseph Wright
    Aug 25, 2010 at 20:52
  • Definitely the output. I can provide whatever input to siunitx that is necessary to make scientific notation come out nicely. Thanks!
    – dtlussier
    Aug 25, 2010 at 21:15
  • 4
    @user766308 If you want to typeset a number without a unit, siunitx provides the \num command, e.g. \num{e-4} will print 10^{-4}. Dec 7, 2011 at 12:34

1 Answer 1

59

Sure: \SI{1e-4}{\metre}.

8
  • 4
    Ok - thanks. What about a number like 10^{-4} that isn't scientific notation but has an exponent?
    – dtlussier
    Aug 25, 2010 at 20:50
  • 23
    \SI{e4}{\metre}
    – Joseph Wright
    Aug 25, 2010 at 20:53
  • 7
    @Kit. \sisetup{exponent-base = <whatever>} using the current release (v2) of siunitx, or \sisetup{expbase = <whatever>} with v1.
    – Joseph Wright
    Jan 18, 2011 at 15:44
  • 1
    @hertzsprung after a quick look at the manual, try scientific-notation=true. Mar 20, 2015 at 14:52
  • 3
    @anderstood Yes, the latter doesn't make sense. \si is for writing just a unit, 10^4 is a number. If you want just the number, use \num{e4}. Nov 18, 2015 at 21:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .