# Equations: \Bigg[ not compiling around three conditions as I'd imagine. Alternative to \Bigg[?

How can I place the three conditions aligned within the curly brackets, sum and square brackets?

I want this:

But I get this:

\documentclass{article}
\usepackage{amssymb,amsmath}

\begin{document}

$$\max_{r_1 < r_j < r_2 } \begin{cases} \sum_{r=1}^{r_j-r_1} \Bigg[ 1 & if \quad xyz\\ -1 & if \quad abz\\ 0 & if \quad blah \Bigg] - somethinig \end{cases}$$

\end{document}


What should I use instead of \Bigg[ and \Bigg]?

Am I using the wrong packages and/or what is wrong with my syntax?

If I compile this:

\documentclass[12pt]{article}
\usepackage{amsmath}
\begin{document}
$\max_{r_1<r_j<r_2}\left\{\sum_{r=1}^{r_j-r_1} \left[\begin{array}{cl} 1&\text{if }xyz\\ -1&\text{if abz}\\ 0&\text{if blah} \end{array}\right]\quad\text{---}\quad\text{something}\right\}$
\end{document}


then I get this:

This is what you're after, or something like it:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

$\max_{r_1 < r_j < r_2 } \left\{ \sum_{r = 1}^{r_j - r_1} \left[ \begin{array}{ @{} r l @{} } 1 & \text{if xyz} \\ -1 & \text{if abz} \\ 0 & \text{if blah} \end{array} \right] - \text{something} \right\}$

\end{document}


You've mixed in the brackets on a by-row basis, when it should be outside the expression in order to span across it vertically. My approach uses \left...\right instead, since the content to stretch the fences around is large enough.