1

SX! 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)?

    ± looking like a binary operator due to issues with \left and \right

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

    \biggl\biggr around summation

    instead of

    \left\right around summation?

    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!

  • 2
    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. – egreg Mar 14 at 23:21
  • 1
    \left and \right are tex primitives they are not tex definitions that are defined and changeable from within tex. – David Carlisle Mar 14 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{...}. – John Kormylo Mar 15 at 1:19
2

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.

| improve this answer | |
  • 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 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? – Donald Arseneau Mar 26 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 at 23:07
  • All I can think of is hiding some height and depth of \sum (like \smash), and that would have deficiencies. – Donald Arseneau Mar 29 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.