3

How to make the second brace as large as the first in align mode?

enter image description here

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
 g\left( {x,y} \right) =& {e^x}\left\{ {x + \left[ {\frac{{xy^3}}{2}\left(     {{x^2} - {y^2}} \right) - 3} \right]} \right. \nonumber\hfill \\
  &\left. {x - y + 5} \right\}
\end{align} 

\end{document}
Mike
  • 591

1 Answers1

4

You can break across lines, with the DeclarePairedDelimiter from mathtools. Adapting a code in the documentation, I define a \brkbraces command, the argument of which accepts & and line breaks, as follows:

\documentclass{article}
\usepackage{mathtools}

\newcommand\MTkillspecial[1]{% helper macro
\bgroup
\catcode`\&=9
\let\\\relax%
\scantokens{#1}%
\egroup
}
\DeclarePairedDelimiter\brkbraces\{\}
\reDeclarePairedDelimiterInnerWrapper\brkbraces{star}{
\mathopen{#1\vphantom{\MTkillspecial{#2}}\kern-\nulldelimiterspace\right.}
#2
\mathclose{\left.\kern-\nulldelimiterspace\vphantom{\MTkillspecial{#2}}#3}}

\begin{document}

\begin{align}
  g\left(x,y \right) & = e^x \!\begin{aligned}[t]\brkbraces*{ & x + \left[ \frac{xy³}{2}\left(x² - y²\right) - 3 \right] \\
  & x - y + 5 }
  \end{aligned}
\end{align}

\end{document} 

enter image description here

The star version is equivalent to a pair of \left … \right, but you can fine-tune the size of the braces using one of the optional arguments \big, \Big, \bigg, \Bigg.

Also, I simplified your code, as I disn't see the reason for all these pairs of braces

Bernard
  • 271,350