3

How can I put parentheses around several lines in the align* environment?

\begin{align*}
    a &= b\\
    aa &= bb\\ % ) these lines in parenthesis
    aaa &= bbb\\ % )
    aaaa &= bbbb\\
\end{align*}

enter image description here

This question is very much related to How do I put a side brace around several lines in the align* environment?. However, it differs in 1) the left side is also included 2) there is no tikz decoration command for parenthesis.

Matti
  • 1,003
  • 2
  • 10
  • 24

2 Answers2

3

I almost achieved a good-looking result by sticking an aligned environment inside the align*, but the horizontal spacing was not quite aligned.

So here, instead, I make a stack of the parenthesied items. Note that a number of stacking parameters were defined in the preamble...

\documentclass{article}
\usepackage{amsmath,stackengine}
\setstackEOL{\cr}
\strutlongstacks{T}
\stackMath
\setstackgap{L}{1.1\baselineskip}
\begin{document}

\begin{align*}
    a &= b\\
    \biggl(
    {\Centerstack[r]{
    aa \cr % ) these lines in parenthesis
    aaa % )
    }}
    &
    {\Centerstack[l]{
    {}= bb\cr % ) these lines in parenthesis
    {}= bbb % )
    }}\biggr) \\   
    aaaa &= bbbb\\
\end{align*}
\end{document}

enter image description here

3

You might use blkarray:

\documentclass{article}
\usepackage{amsmath,blkarray,array}

\begin{document}

\[
\renewcommand{\arraystretch}{1.2}
\begin{blockarray}{r@{}>{{}}l}
   a &= b\\
\begin{block}{(r@{}>{{}}l)}
  aa &= bb\\
 aaa &= bbb\\
\end{block}
aaaa &= bbbb
\end{blockarray}
\]

\end{document}

enter image description here

egreg
  • 1,121,712