# siunitx: enclose all units in brackets

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?

• DON'T DO THAT There's a reason why 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. – Massimo Ortolano Jun 23 at 20:34
• @Massimo Ortolano I completely agree though I have provided a technical solution to the question of the OP in my answer below. – Matthias Jun 23 at 22:06

As 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.