# Parentheses around several lines in align*

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*}


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.

• Well, why should there be a parentheses at all? – user31729 Aug 29 '16 at 17:07

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}


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}