1

I have many nested \left( and \right) parentheses in my document and I'm trying to find a flexible way to make outer pairs larger.

Unfortunately, I cannot use \delimitershortfall recommended here. That made me try \vphantom.

Most of the time, \vphantom has zero width but when \left( and \right) are nested, it looks like \vphantom's width becomes non-zero:

\documentclass{article}

\begin{document}

\(  \left( \vphantom{\Big|} \left( x \right)  \right)  \) 

\(  \left(  \left( x \right) \vphantom{\Big|} \right)  \)

\end{document}

enter image description here

Is there a way around it?

I tried to add \hspace{-0.17em} in order to compensate for the non-zero width of \vphantom above but it's probably not a good solution because \vphantom's behaviour appears to be inconsistent. For example, if you replace the inner pair with normal parentheses the problem disappears:

\documentclass{article}

\begin{document}

\(  \left( \vphantom{\Big|} ( x )  \right)  \) 

\(  \left(  ( x ) \vphantom{\Big|} \right)  \)

\end{document}
Leo
  • 399
  • Max already provided a nice answer below. I just want to add that Knuth himself encourages \big (and friends) over \left...\right in the TeXbook. – Ruixi Zhang May 22 '20 at 03:18
  • @RuixiZhang the correct form in latex is \bigl and \bigr. Otherwise you could mess up spacing. (example, \big( - A \big) makes latex think you are substracting A from the left paren) – Max Xiong May 22 '20 at 12:57
  • Many math characters vary their spacing depending on what is next to therm. It helps to throw in an occasional \null. – John Kormylo May 22 '20 at 14:39
  • @MaxXiong Well, I said “\big (and friends)”… – Ruixi Zhang May 26 '20 at 00:24

1 Answers1

2

The extra space is caused by the interaction between the \vphantom and \left(. TeX's spacing rules will add a space between them. The same problem occurs even just putting a regular variable before \left(. If you want to remove the space, do \! after \vphantom.

Better yet, if you want a global solution, use the mleftright package.

As a side-note, for the example you gave, a better way of achieving the result would be \bigl( ( x ) \bigr). \left and \right are often just too big so I don't like using them unless I have to.

Max Xiong
  • 281
  • 1
  • 4