7

Consider the following example:

\documentclass{article}

\usepackage{mathtools}
\usepackage{siunitx}

\begin{document}

\begin{align*}
 \sisetup{group-minimum-digits = 6}
  l
  &= \frac{\SI{10000}{\m}+\SI{10000}{\m}}{\num{10000}}\\
  &= \SI{2}{\m}
\end{align*}
\begin{align*}
 \sisetup{group-minimum-digits = 6}
  l
  = \frac{\SI{10000}{\m}+\SI{10000}{\m}}{\num{10000}}
  = \SI{2}{\m}
\end{align*}

\end{document}

output

Why is the minimum grouping of digits not change to six in the first example (as I would like it to) while it is in the second example?

P.S. In this particular example, I know grouping of five digits is 'the best' choice but it's just to illustrate my point. Also, I know I shouldn't use align for one-lined expressions.

1 Answer 1

8

Each component with the align-like constructions form a group. As such, changes - like (re)definitions, including \sisetup are local to that cell. Move \sisetup to a cell of interest and you'll see a different output. However, these things should ideally be set globally (outside the align-like environment).

4
  • I see. So should I set it like {\sisetup{group-minimum-digits = 6} \begin{align*} l &= \frac{\SI{10000}{\m}+\SI{10000}{\m}}{\num{10000}}\\ &= \SI{2}{\m} \end{align*}}? Dec 30, 2014 at 1:19
  • Why not include \sisetup in your preamble?
    – Werner
    Dec 30, 2014 at 1:30
  • Because I don't want the same grouping of digits all the way through the document. Dec 30, 2014 at 1:40
  • @SvendTveskæg: For a localized change, I would suggest \SI[<options>]{<num>}{<unit>}.
    – Werner
    Dec 30, 2014 at 1:42

You must log in to answer this question.

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