[Tex/LaTex] Correct placement of sum limits

vertical alignment

this is maybe some captious question like the correct placement of := but I always notice the unattractive placement of the limits between two sums.

Lower limit example (The same holds for the upper limit as well.):

\sum_{j=1}^m \sum_{\langle i,j \rangle}

Different limit-placement

I know its due to the different shapes but is there any way to adapt that?

Thanks a lot in advance!

Best Answer

You can use a \mathstrut to give the both subscripts the same height and depth:

Sample output

\documentclass{article}

\begin{document}

\begin{displaymath}
  \sum_{\mathstrut j=1}^m \sum_{\mathstrut \langle i,j \rangle} 
\end{displaymath}

\end{document}

A \strut is a vertical rule of zero width, so invisible, defined by latex each time a font is set, however these don't change with different parts of mathematics expressions such as subscritps. In mathmode the latex kernel defines

\def\mathstrut{\vphantom(}

which produces a vertical rule of the same height and depth as a bracket in the current math style, but again with zero width. Thus adding \mathstrut to an expression will guarantee that it has height and depth at least that of the bracket (. If your expressions have greater height, then it would be more appropriate to use \vphantom{...} with the ... a copy of the expression with most height.

Related Question