19

Using the siunitx package, if I specify an error with the \pm symbol then it automatically converts it to a form using parenthesis. I would like it to not do this and keep the \pm symbol, but still space the elements of the quantity and symbol in a good way.

e.g. \SI{10 \pm 2}{\kelvin} would produce 10(1) K

I would like it to produce: 10\pm1 K or something similar with spacing taken care of.

32

You want the separate-uncertainty switch, p.30 of the documentation.

\usepackage[separate-uncertainty=true]{siunitx}

sets this format for every number, or

\SI[separate-uncertainty=true]{whatever}

just for one.

  • 1
    Ant, you're a star, just the correct option. I'm surprised I didn't find it myself as I thought I did a search for "uncertainty" in the manual. No matter. Thanks very much – aghsmith Sep 6 '11 at 21:45
  • 1
    I'd note that \sisetup{separate-uncertainty=true} is also an option, which can be called in your document before you need the format change. – CharlieB Dec 2 at 11:46
17

I've just come across the same problem and this is how I solved it to my satisfaction:

in the preamble:

\usepackage[separate-uncertainty = true,multi-part-units=single]{siunitx}

in the text:

(\SI{284(10)}{\ampere})

Produces the following output: 284 ± 10 A

If multi-part-units=single option isn't given, the result will look like: ((284 ± 10) A) which, in my opinion, is less than optimal.

HTH

  • Hmm, it even seemed multi-part-units=single was sufficient for me. You don't need the first part to achieve the same result... but that's 5 years later. – JHBonarius Mar 3 '18 at 18:28
  • I needed the first part as of 06/2019. – Steve Hatcher Jun 17 at 23:13

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.