1

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{equation}
    \begin{split}
        A  = & \left( a + B + \right. \\
             & \phantom{\left(} + c + d \right)
    \end{split}
\end{equation}

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)

3

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

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

enter image description here

| improve this answer | |
  • 1
    Please ={}&... And B+{} wouldn't be bad either :-) – campa Mar 21 '18 at 16:22
3

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}
\begin{equation}
A =\! \begin{aligned}[t]
  \brparen[\Big]{& a + B +{} \\
         & + c + d }\
\end{aligned}
\end{equation}

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

enter image description here

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

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

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

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{equation}
    \begin{split}
        A  = & \left( \frac{a}{b} + B + \right. \\
             & \left. \phantom{\frac{a}{b}} + c + d \right)
    \end{split}
\end{equation}
| improve this answer | |
  • 1
    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

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.