# Align math expressions next to the bracket?

My current code (LaTeX formula in Jupyter notebook's markdown) looks like below:

\left \{ \begin{array}{c l}
&MSE_{node} = \sum_{i \in node}^{} \left ( \hat{y} - y^{i} \right )^2 \\
&\hat{y}_{node} = {\frac{1}{m_{node}} \sum_{i \in node}^{}y^{(i)}}
\end{array}
\right.


which gives the output like this:

There are 2 questions:

1. How can I align those lines to the beginning of the open bracket, instead of having them quite indented like that?
2. How can I move the $i \in node$ below the sum?
• The reason the expressions are shifted to the right in the array is that each of them starts with & except for the \quad in the middle row. The \quad is set (logically) before the position of the &, shoving the other two lines to the right. Jan 5, 2023 at 4:36

This is hard to answer without knowing exactly what markdown system you're using, and how much LaTeX it can handle, but in regular LaTeX, you might consider using a cases environment rather than an array, and you can use the \limits command to put the i ∈ node under the \sum's.

You shouldn't put whole words in math mode without using something like \mathit or \mathrm to space the letters normally:

\begin{cases}
\mathit{MSE}_{\mathit{node}} = \sum\limits_{i \in \mathit{node}} \left( \hat{y} - y^{i} \right)^2 \\[3ex]
\hat{y}_{\mathit{node}} = {\frac{1}{m_{\mathit{node}}} \sum\limits_{i \in \mathit{node}}^{}y^{(i)}}
\end{cases}


Alternatively you can use \displaystyle to put the whole part in display mode, which will yield bigger \sum's.

\begin{cases}
\mathit{MSE}_{\mathit{node}} = \displaystyle\sum_{i \in \mathit{node}} \left( \hat{y} - y^{i} \right)^2 \\[3ex]
\hat{y}_{\mathit{node}} = {\frac{1}{m_{\mathit{node}}} \displaystyle\sum_{i \in \mathit{node}}^{}y^{(i)}}
\end{cases}


• Thanks, both solutions work. I'm writing a markdown in a Jupyter notebook. Jan 4, 2023 at 3:40