27

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.

0

2 Answers 2

41

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.

3
  • 2
    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, 2011 at 21:45
  • 2
    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, 2019 at 11:46
  • In version v3 of siunitx, use \qty instead of \SI.
    – Leone
    Jul 7, 2022 at 19:23
27

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

3
  • 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, 2018 at 18:28
  • I needed the first part as of 06/2019. Jun 17, 2019 at 23:13
  • I had to use both separate-uncertainty=true to create the pm sign and multi-part-units=single to get rid of the parenthesis (i want 850±15 nm instead of (850±15) nm )
    – Zciurus
    Mar 29, 2023 at 7:15

You must log in to answer this question.

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