phantom and parentheses in multiline equation

When I have a multiline equation enclosed by parentheses, that I want to split, why is the brackets command inside the phantom one, not recognised by the right bracket command? For example, if I have

$$\begin{split} A = & \left( a + B + \right. \\ & \phantom{\left(} + c + d \right) \end{split}$$


I get an error, but if I just use left. instead of \phantom{left(}, everything is fine (I'm trying to make some space to simulate the parentheses)

There are \big, \Big, \bigg, and \Bigg:

$$\begin{split} A = {} & \Big( \frac{a}{3} + B + {} \\ & + c + d \Big) \end{split}$$


• Please ={}&... And B+{} wouldn't be bad either :-) Mar 21 '18 at 16:22

You can have a simple syntax with DeclareMathDelimiter, from the mathtools package: I define a \brparen command that allows for line breaks and alignment points, and adapts to its contents either with an optional argument (\big, \Big, &c.) or with a star version (equivalent to a pair of left … \right):

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}
\newcommand\MTkillspecial[1]{% helper macro
\bgroup
\catcode\&=9
\let\\\relax%
\scantokens{#1}%
\egroup
}
\DeclarePairedDelimiter\brparen
\lparen\rparen
\reDeclarePairedDelimiterInnerWrapper\brparen{star}{
\mathopen{#1\vphantom{\MTkillspecial{#2}}\kern-\nulldelimiterspace\right.}
#2
\mathclose{\left.\kern-\nulldelimiterspace\vphantom{\MTkillspecial{#2}}#3}}

\begin{document}
A =\! \begin{aligned}[t] \brparen[\Big]{& a + B +{} \\ & + c + d }\ \end{aligned}

A =\! \begin{aligned}[t] \brparen*{& \frac{H^2}{K^2} + B + \\ & + c + d } \end{aligned}
\end{document}


• +1 for the nice hacking, though I don't like hiding parentheses over multiple lines in some macro... Mar 21 '18 at 16:26

The problem is that the \left( is inside the \phantom, \phantom should be used differently. Consider the following modification of your example.

$$\begin{split} A = & \left( \frac{a}{b} + B + \right. \\ & \left. + c + d \right) \end{split}$$


This makes the \left( and \right) appear as different sizes. We must add \phantom{\frac{a}{b}} to the second line (between \left. and \right)), this will ensure that the \right) has the same size as the \left(.

$$\begin{split} A = & \left( \frac{a}{b} + B + \right. \\ & \left. \phantom{\frac{a}{b}} + c + d \right) \end{split}$$

• A vexing issue arises in your solution: the space between B and the final + symbol in the first row is incorrect. (Actually,this issue also surfaces in Herbert's solution, as well as in one of Bernard's two solutions...) TeX is interpreting your code as implying that the final + symbol is a unary rather than a binary operator. To fix this issue, insert {} between the final + symbol and \right.`.
– Mico
Mar 21 '18 at 15:19