Which siunitx options to set globally?

On the TeX.SX site recently, there was some discussion about locally over-riding the round-mode = places setting in my siunitx package. One thing this highlights for me is the need to think about which settings to apply globally.

Some siunitx settings are about consistency of appearance, and seem to apply naturally to entire documents. A classic example would be output-decimal-marker: if you are using , as a decimal marker, it should apply everywhere!

However, this is not so clear-cut for many of the options related to number-manipulation. The rounding options in particular are really intended for the case where you have some auto-generated data (say a long list from an instrument), and the real accuracy is not as great as the apparent precision. Instruments are great at providing lots of numbers, but it takes a bit of human thought to decide how many of these are really relevant. So for these cases, setting an appropriate rounding scheme is perfectly sensible.

On the other hand, for a number you’ve typed in yourself I’d hope that you’ve done the thinking part when the number is typed, so rounding by the computer is not needed. That suggests to me that most of the time rounding should not be set as a global option.

Of course, it will depend on the exact nature of the document in question. If all of the data in a document is in tables, all of which need rounding, then there is a performance gain from setting the rounding once globally. So the best I can say, guidance-wise, is ‘think about your document’!

2 thoughts on “Which siunitx options to set globally?

  1. I think that all options should be local unless there are strong technical counter-arguments. output-decimal-marker is a good example: in multi-language documents, you absolutely want more than one decimal marker! The only options that should be global are those which are intimately bound to the whole document, e.g., the driver option of the graphicx package and things like that. Skimming through the siunitx manual, the only such option seems to be load-configurations (not really an option, however, but rather a command).

  2. I’d disagree: the decimal marker is set by the typographic locale you are writing for, not the language you are writing in. In a multi-language document, it would be potentially very confusing if you swapped typographic conventions part-way through.

    Many of the siunitx options are about appearance, and may well apply globally. For example, some people will prefer to have ‘m/s’ than ‘m s^{-1}’ for division of units, and if you change that it should be for all of the document.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.