# Why should I “enclose the previous parenthesis with ‘{}’”?

I stumbled across this line in chktex (here) with a note saying

This is a warning which you may ignore, but for maximum aestethic pleasure, you should enclose your bracket characters with {}'s.

What happens (technically) if I add these brackets?

The following MWE shows the difference with and without the additional brackets; note that the version with the additional brackets results in the superscript being a little bit higher (which, according to chktex seems to be preferred?).

\documentclass{scrartcl}
\title{}
\begin{document}

$$\{X\}^T {\{X\}}^T$$

\end{document}


• That's simply wrong advice. Complain with the developers of chktex. If you want to avoid the wrong warning, use \lbrace X\rbrace^T. – egreg Feb 25 at 13:11
• So the slightly higher superscript is not desired? – dpaetzel Feb 25 at 13:15

Apparently, the developer of chktex advises to always do something like

{(a+b)}^2


which is not what's normally done. There's no need for it and the output is very disputable in typographic terms: compare by yourself, left the normal, right the braced combo:

\documentclass{article}
\begin{document}

$$(a+b)^2 \quad {(a+b)}^2$$

$$(\sqrt{2}+1)^2 \quad {(\sqrt{2}+1)}^2$$

\end{document}


The second one is obviously wrong. The warnings of chktex are

Warning 3 in badchk.tex line 5: You should enclose the previous parenthesis with {}'.
^
Warning 3 in badchk.tex line 9: You should enclose the previous parenthesis with {}'.
^


and I heartily disagree.

• On one hand it is uglier with the dynamically scaling exponent height, but on the other hand semantically in tex (a+b)^2 means that the right parenthesis has a superscript, rather than the whole expression, which makes me feel unclean. – SamYonnou Feb 25 at 22:49
• @SamYonnou Don't feel unclean. That's how it has been done for a few centuries. The exponent is indeed to the whole expression delimited by the parenthesis: no need to add levels. – egreg Feb 25 at 22:49
• I mean in tex as a computer language specifically, not in conventional mathematical notation – SamYonnou Feb 25 at 22:51
• @SamYonnou Really, that's the way it should be done. Braces around math material make a subformula, where spaces are frozen and other things happen. Sometimes it's useful, generally it isn't. – egreg Feb 25 at 22:54

Using braces seems to be either irrelevant or bad.

In display mode,

\documentclass{article}

\begin{document}

$$\left(\sqrt 2 + 1\right)^2 = {\left(\sqrt 2 +1\right)}^2$$

\end{document}


the result is identical.

Inline, using braces disturbs the interline spacing.

No braces (\sqrt 2 + 1)^2:

Braces {(\sqrt 2 + 1)}^2`:

Conclusion: disable chktex Warning 3 permanently.