Take the 2-minute tour ×
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.

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?

share|improve this question
    
Not quite understood, \smashoperator smashes both upper and lower limit. Or is what you are asking for, that if the summand is short, then the with of the limits should still be taken into account? That case is IMO too special to make a makro for it, I would just pull back the s by hand. –  daleif Dec 23 '11 at 11:33
    
If the middle sum would stand on its own \smashoperator would do the job. But here the = should not move under the upper limit only the s. How do I move the s easily? What commands are there to achieve this? –  uli Dec 23 '11 at 11:36
    
Ugly Hack: You can always insert some negative horizontal space just before s i.e. \hspace{-2ex}s –  percusse Dec 23 '11 at 11:50

2 Answers 2

up vote 14 down vote accepted
\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}
share|improve this answer
    
haha, yes, ofcourse! –  morbusg Dec 23 '11 at 12:13

Maybe if you make the \sum s a single \mathop entity:

\let\hw\hidewidth
$$
  \sum_{\hw s=n-t+1\hw}^{j-1} s-(n-t)
  =\mathop{\sum s}_{s=1}^{j-1-(n-t)}={\bigl(j-1-(n-t)\bigr)\bigl(j-(n-t)\bigr)\over2}
$$
\bye
share|improve this answer
    
Then the lower limit is centered incorrectly. –  uli Dec 23 '11 at 11:55
    
@uli: Oh, bummer. You could stuff a \enspace (or something along that size) at the end of the lower limit, but it's ugly. –  morbusg Dec 23 '11 at 12:00
    
or you could use \mathop{\phantom{s} \sum s} and then the limits will be centered because the new operator is "symmetrical." –  Phineas Q. Butterfats Aug 8 '13 at 19:40

Your Answer

 
discard

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.