# Adjusting the vertical position of the limits of a sum

Is there a way to vertically adjust the lower limits of the two sums below, such that 'p' and 'q' are vertically aligned?

\sum_{p=1}^{\mathcal{M}}\sum_{q\in\mathfrak{N}_p^+}

EDIT: As per egreg's comment below, I tried

\sum_{p=1\vphantom{\mathfrak{N}_p^+}}^{\mathcal{M}}\sum_{q\in \mathfrak{N}_{p}^+}

This results in

However, I would prefer to shift the second lower limit up to the first, than the other way round. I tried

\sum_{p=1}^{\mathcal{M}}\sum_{q\in\mathfrak{N}_{p}^+\vphantom{p=1}},

but this does nothing.

• You need _{p=1\vphantom{\mathfrak{N}_p^+}} Sep 10 '20 at 10:16
• Okay, thanks. This shifts the vertical position of the first subscript. And I also tried applying it to the second subscript, but it does not shift it upward. I would prefer to align the second with the first, than the other way round. Sep 10 '20 at 10:21

You can equalize the two subscripts by using a phantom.

I like more the (more complex) second suggestion where the + is smashed at the top, so the two subscripts are a bit nearer the summation sign.

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

\begin{document}

Original
$\sum_{p=1}^{\mathcal{M}}\sum_{q\in\mathfrak{N}_p^+}$

First suggestion
$\sum_{p=1\vphantom{q\in\mathfrak{N}_p^+}}^{\mathcal{M}}\sum_{q\in\mathfrak{N}_p^+}$

Second suggestion
$\sum_{p=1\vphantom{q\in\mathfrak{N}_p^{\smash[t]{+}}}}^{\mathcal{M}}\sum_{q\in\mathfrak{N}_p^{\smash[t]{+}}}$

\end{document}


For producing the rule on the baseline I used a trick not shown in the code above.

• Your second suggestion is just what I'm looking for! Thanks so much! Sep 10 '20 at 10:30