[Tex/LaTex] siunitx: How to unset options previously set with \sisetup

groupingsiunitx

In the siunitx package (v1.3), I know that I can set various options with the \sisetup command. But what if I want a particular option to apply to only a small section of my document, with default behaviors for the rest of the document? How can I "unset" an option I have set and return to defaults?

Here is essentially what I'm trying to do:

Some text with SI units using default options.
\sisetup{prespace}
Some text with SI units using prespace option.
\sisetup{undo prespace, reset to default}
Some more text with SI units using default options.

Is this possible?

Best Answer

If the scope of the command is to be limited to a single table environment, say, then issuing the command \sisetup after the \begin{table} statement (but before a \begin{tabular}{...} statement) will automatically achieve your goal.

More generally, you could confine the scope of the \sisetup command by "encasing" it in a pair of \begingroup ... \endgroup commands or, less visually intrusive, with a pair of curly braces -- { and }.

Separately, the current version of the siunitx package is 2.3. If you're still working with version 1.3, as your question seems to indicate, you may want to consider upgrading the package to the latest version. :-)

Related Question