61

Is there a way to show \sum limits partially in inline mode and partially in display mode? I want to write:

\begin{equation}
\sum_{n=-\infty}^{+\infty} [...]
\end{equation}

but this way the lower limit is too wide, and I don't like it. So I was hoping to write something like this:

\begin{equation}
\sum_{-\infty}^{+\infty}\nolimits_{n} [...]
\end{equation}

to write the index n on the right side of the sum symbol, while the limits of the summation remain above and below.

Of course it doesn't work, LaTeX is pissed because there is a double subscript. Anyone knows if it's possible to do what I want to?

0

1 Answer 1

73

In this instance a better approach would be to use mathtools's \mathclap, which provides a centred overlap in math mode. The centred overlap implies a zero-width box containing stuff that overlaps on the left and right:

enter image description here

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\begin{document}
\begin{align*}
  A &= \sum_{n=-\infty}^{+\infty} f(x) \\
  B &= \smashoperator[r]{\sum_{n=-\infty}^{+\infty}} f(x) \\
  C &= \sum_{\mathclap{n=-\infty}}^{+\infty} f(x) \\
  D &= \sum_{\substack{n={}\\-\infty}}^{+\infty} f(x) \\
  E &= \sum_{-\infty}^{\infty}\mathop{}_{\mkern-5mu n} f(x)
\end{align*}
\end{document}

Sure mathtools also loads amsmath, but both these provide excellent tools in terms of typesetting mathematical content (and otherwise).

To add multiple things under a math operator (like \sum), see How do you put multiple things under a limit?, which suggests \substack (as I've done in the last horrible visual).

3
  • 3
    If you asked me, I vote for option no. 2.
    – yo'
    Jan 5, 2013 at 13:13
  • Thank you. I am looking for something like point E., but with \prod, not \sum. When I tried copying using \mathop{}_{\mkern-5mu n} it did not look so good. How would you do it with prod?
    – user119615
    Feb 9, 2017 at 12:09
  • 1
    I know it's an old answer but I put in my two cents nonetheless: the last version can be IMO better achieved by using amsmath's own \sideset macro: \sideset{}{_n}\sum_{-\infty}^{\infty}.
    – campa
    Feb 20, 2020 at 8:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .