5

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

I want this:

enter image description here

But I get this:

enter image description here

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

\begin{document}


\begin{equation}
    \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{equation}

\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?

2 Answers 2

5

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:

enter image description here

7

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.