How to write an Equation with the Units aligned off right and adapted Bracket Heights around the Unit?

Assumed I have this MWE to align the units off right:

\documentclass{article}
\usepackage{amsmath}
\usepackage{siunitx}

\makeatletter
\renewcommand\tagform@[1]{%
}
\makeatother

\begin{document}

Unfortunately the bracket does not fit to the height of the unit.
The units exponent is already positioned above the upper edge of the bracket. :-(

$$A = B + C \tagaddtext{[\si{\square\meter}]}$$

How can I change this behavior?

\end{document}


Screenshot of the result:

Description of the eyesore:

As you can see the corresponding brackets do not automatically adapt to the height of the unit. The exponent is higher than the bracket.

How can I change that behavior, so that the brackets will automatically adjust to the height of the highest/lowest point of the unit?

• You can use \tagaddtext{$\left[\si{\square\meter}\right]$}. But this is usually not recommended. The image you show is the correct behavior AFAIK. – Peter Grill Dec 6 '18 at 19:44
• @PeterGrill: Thanks a lot! Could I implement the brackets into the \newcommand-configuration already? So that I only have to write \tagaddtext{\si{\square\meter}} into the document text and the brackets will show up automatically? – Dave Dec 6 '18 at 19:47
• @PeterGrill: Excuse me, one more question: Why is your approach usually not recommended? Is it faulty typography to increase the brackets size matching to the exponents? – Dave Dec 6 '18 at 21:57
• @PeterGrill: Ah, I understand! Thank you very much for your help! I will stop using \left[ ... \right] now at all. I never tought about those spacing problems... – Dave Dec 7 '18 at 8:27

I propose for what it's worth a work-around with flalign and an \addunit command:

\documentclass{article}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\usepackage{mathtools}
\usepackage{siunitx}


• Thanks a lot! So I should stop using $$blabla$$? Or better use \begin{flalign} inside of ? – Dave Dec 6 '18 at 21:46
• If you want to use \addunit , yes, use flalign in the place of equationflalign can't be used inside another math environment, and flaligned does not exist. – Bernard Dec 6 '18 at 21:51