TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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:

    \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

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)

share|improve this question
Are you maybe missing a pair of parentheses around the argument of the summation on the second line? Just curious. – Mico Apr 18 '12 at 3:17
You are right @Mico. Thanks for pointing that out! – Amelio Vazquez-Reina Apr 18 '12 at 15:28
up vote 12 down vote accepted

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.


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\}\\
  & \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 

enter image description here

share|improve this answer
Using the "starred" version of the \DeclareMathoperator macro would under-set rather than side-set the \mathcal{I} element. :-) – Mico Apr 18 '12 at 3:16
@Mico I didn't notice that; thanks. – egreg Apr 18 '12 at 6:23
+1 mathtools loads amsmath so there's no need to load both explicitly – cmhughes Apr 18 '12 at 8:34
The \mathclap part can also be done via the \smashoperator in mathtools – daleif Apr 18 '12 at 8:57
Thanks @egreg. I'm wondering if there is a way of getting two things aligned vertically, the \sum signs and the = on the last three equations? – Amelio Vazquez-Reina Apr 18 '12 at 15:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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