when I use the command
\SI{1}{\kilo\gram}
I'd like it to output
1 [kg]
Is there a setting so that SIUnitx automatically does this for all units in a document?
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityAs far as I know, there is no such option. You could redefine the \SI
command. Here is a very basic approach which could be improved from the technical point of view in many ways.
\documentclass{article}
\usepackage{siunitx}
\renewcommand{\SI}[3][]{\mbox{$\num[#1]{#2}\,\left[\si{#3}\right]$}}
\begin{document}
\SI{1}{\kilo\gram}
\end{document}
This gives:
Edit: Please note, however, the valid comment by Massimo Ortolano below the question.
siunitx
doesn't do that by default: it's wrong. Please, see this post of mine about the usage of brackets in units and the SI brochure from p. 147 on.