[Tex/LaTex] Aligning sub-equations within align

alignamsmath

Update:

How do I align both the \sum signs and the = signs in the last two equations? I have updated the picture.

Original Question:

When I use the following code:

\begin{equation}
\begin{split}
    \label{eq:BILP}
    \mathpzc{I}^* & = \argmax_{\mathcal{I}} \; \left\{\sum_{i\in \mathcal{V}} \left(\theta_K \cdot \mathbb{I}_{i,j}(1,1) + \theta_K \cdot \mathbb{I}_{i,j}(0,0) \right) + \right.\\
    & \qquad  \qquad \quad \;\,\;\; \left. \sum_{i\in \mathcal{E}} \theta_{i_0} \cdot \mathbb{I}(x_i=0) + \theta_{i_1} \cdot \mathbb{I}(x_i=1) \right\}\\
    & \qquad \qquad  \text{s.t.} \; \; \sum_{x_j} \mathbb{I}_{i,j}(1,x_j)  =   \mathbb{I}(x_i=1) \\
    & \qquad \qquad  \qquad \sum_{x_i}\mathbb{I}_{i,j}(x_i,1) =   \mathbb{I}(x_j=1) \\
    & \qquad \qquad  \qquad \sum_{x_i,x_j}\mathbb{I}_{i,j}(x_i,x_j) = 1 \\
    %& \;\psi_{\mathrm{SAT}}\left(\mathbf{s}, \mathbf{l}\right) = 1
    \end{split}
    \end{equation}

I get the following (note the misalignment between the \sum signs, and the = signs highlighted under the red lines):

    enter image description here

How can I get them to align? (and avoid using all the artificial \qquad, \, \; spaces)

Best Answer

Use the \bigg variety for bigger delimiters and align the sums. There's a subtlety for the last one, since the long subscript would shift it to the right and \mathclap from mathtools avoids it.

\documentclass{article}

\usepackage{amsmath,amssymb,mathtools}
\DeclareMathOperator*{\argmax}{argmax}
\begin{document}
\begin{equation}\label{eq:BILP}
\begin{split}
I^* = \argmax_{\mathcal{I}}\biggl\{
  & \sum_{i\in \mathcal{V}} (\theta_K \cdot \mathbb{I}_{i,j}(1,1) + \theta_K \cdot \mathbb{I}_{i,j}(0,0) ) + {}\\
  & \sum_{i\in \mathcal{E}} \theta_{i_0} \cdot \mathbb{I}(x_i=0) + \theta_{i_1} \cdot \mathbb{I}(x_i=1) \biggr\}\\
\text{s.t.}\quad
  & \sum_{x_j} \mathbb{I}_{i,j}(1,x_j)  = \mathbb{I}(x_i=1) \\
  & \sum_{x_i}\mathbb{I}_{i,j}(x_i,1) = \mathbb{I}(x_j=1) \\
  & \sum_{\mathclap{x_i,x_j}}\mathbb{I}_{i,j}(x_i,x_j) = 1 
\end{split}
\end{equation}
\end{document}

enter image description here