I am writing a math paper and I have a lot of complicated expressions some with fractions or absolute values, some with normal symbols some with larger symbols etc. So when I use \left( or \right) for parenthesis, they are too big a lot of times (They have other issues of spacing as well which is handled in the mathtools package. But the size is still a problem).

Of course one way out is to manually enter \Big, \big etc. but this becomes problematic as then it is very difficult to be consistent across the document (For e.g. in one formula I use \Big and 20 pages later I use \bigg as I have completely forgotten that I used \Big earlier on).

So is there a way to write a macro that will check the size of the input and then put brackets as either (), \big( \big), \Big( \Big), \bigg( \bigg) or \Bigg( \Bigg)?. Any help would be appreciated!

Edit: See this code for a sample problem




The parentheses and absolute value are too big
\int\abs*{\partial_{\alpha '}\frac{1}{Z_{\alpha '}}}^2 \text{ and } \int\paren*{\partial_{\alpha '}\frac{1}{Z_{\alpha '}}}^2

compared to 
\int\abs[\Big]{\partial_{\alpha '}\frac{1}{Z_{\alpha '}}}^2 \text{ and } \int\paren[\Big]{\partial_{\alpha '}\frac{1}{Z_{\alpha '}}}^2

  • Anyway it should be \bigl( and \bigr). AFAIK, there are no automatically calculating algorithms other than \left and \right. What you see there are the drawbacks of such algorithms. About consistency: you should always get the parenthesis which looks right. There's not a consistency issue imo. – Moriambar Apr 13 '17 at 20:12
  • I still think there should be a way to do this. I mean if I could get a handle on the size of the input, then I could just write an if then else code which does this job. Latex definitely calculates these sizes, though I don't know how to access them or what they are called. Having such a code makes life infinitely simpler and elegant as compared to manually entering. – Siddhant Apr 13 '17 at 21:17
  • left and right calculate the sizes by creating a subformula, around which they wrap (as far as I understand). Unfortunately, the subformula includes all of the sub elements (how is LaTeX gonna know if something is too high or too low to be comprised in parentheses?) This yields unwanted results, such as the limits of a sum to be comprised by the parentheses, which in turn make the parentheses too big – Moriambar Apr 13 '17 at 21:20
  • Have you seen the solutions here? tex.stackexchange.com/q/360996/117534. Otherwise, please give an example of when and how \left( and \right) are not satisfactory. – Troy Apr 14 '17 at 6:51
  • I saw the answers. All automatic sizing of () have the same height as that of \left( \right), in all the posts that I have ever seen. – Siddhant Apr 14 '17 at 16:35

The (La)TeX way to typeset autoscaled delimiters is \left and \right. mathtools package provides the \DeclarePairedDelimiter command which corrects their spacing a bit, but still uses them in background

As detailed in Appendix G of the TeX book, there is no margin for the user to meddle with TeX way of handling the transformation of a mathematical list to a box, at least reagarding the boundaries.

I strongly recommend to use

  • \bigl, \biggl and similar command for left (i.e. Opening) delimiters
  • \bigr, \biggr and such for right (i.e. closing) delimiters

and manually scale them. Only this way you can guarantee an acceptable and good typographical look.

Please do not be concerned about consistency throughout your book: manually scaling the delimiters will yield the best in each case.

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.