[Tex/LaTex] Improving typesetting of sums with long limits

math-modespacing

This piece of code

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[\smashoperator[r]{\sum_{s=n-t+1}^{j-1}}s-(n-t)=\sum_{s=1}^{j-1-(n-t)}s=\frac{\bigl(j-1-(n-t)\bigr)\bigl(j-(n-t)\bigr)}{2}\]
\end{document}

produces

enter image description here

I’d like to have

enter image description here

commands like \smashoperator or \mathclap are of no use as the width of the upper limit is correctly pushing the equal signs apart. How can I give TeX a hint that I want to move the summand s close to the sigma and under the upper limit?

Best Answer

\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[\smashoperator[r]{\sum_{s=n-t+1}^{j-1}}s-(n-t)=
 \mathop{\sum_{s=1} s}^{j-1-(n-t)}=\frac{\bigl(j-1-(n-t)\bigr)\bigl(j-(n-t)\bigr)}{2}\]
\end{document}
Related Question