How to fix \left and \right formatting in LaTeX?

I frequently come to this website for help on LaTeX formatting, but this is one issue I have not been able to find an answer to.

My question boils down to the fundamental issue with \left and \right. I love \left and \right, but have read countless blog posts and TeX.SE (is it .SE or .SX?) answers (e.g. Is it ever bad to use \left and \right?) about the pitfalls of \left and \right.

Now for my real question(s):

How might you make \left and \right not be mathinner atoms? This seems to be the primary reason that they are distrusted so much: besides typographical concerns such as pushing lines all over the place, they tend to corrupt spacing between equation elements. In addition, might there be a way to edit the macro definition of \left and \right so that they would automatically go one size lower when encompassing things such as summations?

Here are some related issues:

1. How would one change the definitions of \left and \right so that you do not end up with spacing problems such as below (where \pm ends up looking like a binary operator in the first equation due to issues with \left and \right)?

1. How would one change the definitions of \left and \right so that it would size itself to look like

?

Additionally, might there be a way to rig the definition such that superscripts/subscripts would place themselves correctly? I had to use a negative space to place the exponent above, and I am sure that is not at all the only case where superscripts/subscripts get annoying with parentheses. Is there a similar way to fix the interior spacing? For example, I had to use \, to place the summation sign readably distant from the parentheses above.

Thanks!

• You just don't use \left and \right. Typography is a craft and automation works up to a certain point, where human judgment comes in. Mar 14, 2020 at 23:21
• \left and \right are tex primitives they are not tex definitions that are defined and changeable from within tex. Mar 14, 2020 at 23:29
• One solution is to learn all the different ways of spelling \big. Another is to use \smash and \rule{0pt}{...} or \vphantom{...}. Mar 15, 2020 at 1:19
• Not trying to start something, but this entire issue intrigues me. I can't for the life of me understand why the third image is so typographically hideous. I get the points Knuth makes in the TeXbook, but I have yet to see any argument that isn't based on personal taste, indeed Knuth's personal taste (TeXbook, p. 149). I much prefer the more complete enclosure compared to seeing the summation index "hanging out." I'm open to being convinced otherwise, but I'm looking for something more concrete than personal opinion. Oct 14, 2020 at 23:55

0) It is the whole \left...\right subformula that is \mathinner. You can make it \mathord by putting braces around it, or using shorthands like

\def\lft{\bgroup\left} \def\rgt{\aftergroup\egroup\right}


but...

1) Those are thin skips, not med skips, but yes, the braces will get rid of the second one.

2) TeX can't look at the amount of "ink" to decide how much coverage looks good, so you may need to select sizes manually. If you generally don't like the brace coverage, try adjusting \delimiterfactor and \delimitershortfall; maybe

\delimiterfactor=750
\delimitershortfall=9pt


which means the braces must cover at least 75% of the formula (\delimiterfactor is an integer in parts-per-thousand) and also come within 9pt of covering the formula.

3) And there is too much space between the big right parenthesis and the superscript 2, but that is just the curve of the parenthesis. You can manually insert negative spacing (\!) or use square brackets instead of big parentheses.

• Thanks! One issue that I encounter with this solution, however, is that I tend to end up with nested delimiters which I want to grow, and so I usually use \delimitershorfall-1sp. Would this solution interfere with that command to ensure automatic delimiter growth?
– Mel
Mar 25, 2020 at 21:43
• (#2, right?) Those goals are indeed contrary. Only one set of values for the delimiter parameters applies to the whole equation. Macros could be defined to track nesting, but I don't think such an automatic solution is feasible for both goals: what should happen when a big sum and parentheses are surrounded by parentheses? It could be possible to define \sum to hide some depth and height, but what about things like large fractions? Mar 26, 2020 at 4:24
• That is indeed an issue. Is there a different command for auto-sizing that would achieve the same goal that would not interfere with the \delimitershortfall=9pt that you suggest?
– Mel
Mar 28, 2020 at 23:07
• All I can think of is hiding some height and depth of \sum (like \smash), and that would have deficiencies. Mar 29, 2020 at 8:15