# How can I obtain brackets with proper size on multiple lines using the {multline} environment?

My code is of the form

\begin{multline}
\left[ \frac{foo}{bar} \\ foo \right]
\end{multline}


This code gives an error for missing \right. etc. To remedy this, I used this code

\begin{multline}
\left[ \frac{foo}{bar} \right. \\\left. foo \right]
\end{multline}


However, in this code, the right ] bracket is small and is not the same size as the left [. Please let me know if a solution to this exists.

• Welcome to TeX.SX! You can have a look on our our starter page to familiarize yourself further with our format. Jun 28 '13 at 8:28

Manually scaling, i.e. \big, \Big, \bigg or \Bigg. There is no other way. \left...\right has to look at its contents in order to auto scale, and thus line breaks are not allowed.

The [c] indicates center alignment of the stack. [l] and [r] are also options there. Additionally, the stack gap is (by default) 3pt between items. That can be changed with an appropriate specification. Finally, the [ and ] are merely scaled to fit the stack. You can use an optional argument to \scaleleftright as a width limiting feature, if the width of the brackets is too large.

EDITED to show two approaches, depending on how you want your math axis.

\documentclass{article}
\usepackage{stackengine}
\usepackage{scalerel}
\begin{document}
$math-axis \scaleleftright{[} {\Shortstack[c]{\displaystyle\frac{foo}{bar} foo}} {]}$
\def\stackalignment{l}
$math-axis \scaleleftright{[} {\stackanchor[5pt]{\displaystyle\frac{foo}{bar}}{foo}} {]}$
\end{document}


I offer to use the empheq package:

\documentclass[varwidth]{standalone}

\usepackage{amsmath,amssymb,amsthm}
\usepackage{empheq}

\begin{document}
\begin{empheq}[left=\empheqlbrace,right=\empheqrbrace]{align}
\frac{foo}{bar} \\
foo
\end{empheq}
\end{document}


Result:

And, without numbering (align*):