I want to align the limits of a sequence at the equal sign but have an optional modifier before the substack. When I add this optional modifier, the limits are distorted since the modifier is placed in the middle. If I remover it, the limits are okay.
\documentclass{article}
\usepackage{mathtools}
\begin{document}
Distortion
\[
\sum_{k:\substack{
\mathllap{X(S_k)} = \mathrlap{x_i,}\\
\mathllap{Y(S_k)} = \mathrlap{y_j}}
\]
Okay
\[
\sum_{\substack{
\mathllap{X(S_k)} = \mathrlap{x_i,}\\
\mathllap{Y(S_k)} = \mathrlap{y_j}}
\]
\end{document}
Without k

With k




k:\ \substack{}– dustin Oct 10 '14 at 17:30}'s in my solution. – Przemysław Scherwentke Oct 10 '14 at 18:27