# Problem

This MWE with two sums, that have prolonged limits each:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}
$\displaystyle x \wedge y = \sum_{1 \leq i_1 < \ldots < i_p \leq n} \sum_{1 \leq j_1 < \ldots < j_q \leq n} a_{i_1 \ldots i_p} b_{j_1 \ldots j_q} \; \underbrace{e_{i_1} \wedge \ldots \wedge e_{i_p} \wedge e_{j_1} \wedge \ldots \wedge e_{j_q}}_{\text{is sometimes 0}}$
\end{document}


produces a lot of space for the sums. Nevertheless the readability is bad, as the limits are too close to each other. Usage of smashoperator{} will lead to an error and one limit not showing any more. I would much prefer the second formula (or also additionally smashed on the left side of the first sum). # Question

How can I produce the second formula in the picture? (or any other nice looking 'smashed' result)

## Edit

1) I found this (just the sums) code to be close to my desired result. However it yields an undefined control sequence error:

\smashoperator{\mathop{\smashoperator{\sum_{1 \leq i_1 < \ldots < i_p \leq n}\sum}}_{\qquad 1 \leq j_1 < \ldots < j_q \leq n}}


## 4 Answers

Maybe this? with a little help from \mathclap and stackengine. EDIT to replace \ldots with \dots and \cdots, per Mico's request. I hope I interpreted his request in the right way...

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{stackengine}
\stackMath
\begin{document}
$\displaystyle x \wedge y =\qquad \sum_{\mathclap{1 \leq i_1 < \dots < i_p \leq n}}\quad \sum_{\stackunder[5pt]{}{\scriptstyle\mathclap{1 \leq j_1 < \dots < j_q \leq n}}} a_{i_1 \dots i_p} b_{j_1 \dots j_q} \; \underbrace{e_{i_1} \wedge \cdots \wedge e_{i_p} \wedge e_{j_1} \wedge \cdots \wedge e_{j_q}}_{\text{is sometimes 0}}$
\end{document} • +1. Do replace all \ldots instances with \dots -- some of them really need to be \cdots ... – Mico Dec 26 '16 at 22:54
• Wow that was quick! I was just editing in some additional information when you posted this answer already. Looks very good! I have never used stackengine - does it misbehave with other packages (I do need quite a lot packages) ? Also, what does \stackMath in the preamble do? – gr4nt3d Dec 26 '16 at 22:55
• @Mico , why replace the \ldots ? I don't see where \cdots would fit better. – gr4nt3d Dec 26 '16 at 22:58
• @hillbilly The \stackMath in the preamble tells stackengine to, by default, process its arguments in math mode. I think the package is well behaved and, as I wrote it, you can always contact me with bug reports or feature requests. – Steven B. Segletes Dec 26 '16 at 22:59
• @hillbilly - In math typesetting, it's customary to place ellipses located between relational operators -- e.g., those between < symbols -- at a different height from ellipses between simple list items. – Mico Dec 26 '16 at 23:11

I'd simply use one summation sign; but also two can be used. I'd also avoid \smashoperator, unless space constraints require squeezing the thing as much as possible. Probably, in this case, I'd just use \mspace{-9mu} or so on either side of the summation.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{equation*}
x \wedge y =
\sum_{\substack{
1 \leq i_1 < \dots < i_p \leq n \\
1 \leq j_1 < \dots < j_q \leq n
}}
a_{i_1 \ldots i_p} b_{j_1 \dots j_q}
\,
{\underbrace{e_{i_1} \wedge \dots \wedge e_{i_p} \wedge
e_{j_1} \wedge \dots \wedge e_{j_q}}_{\text{is sometimes $0$}}}
\end{equation*}

\begin{equation*}
x \wedge y =
\mathop{\sum\sum}_{\substack{
1 \leq i_1 < \dots < i_p \leq n \\
1 \leq j_1 < \dots < j_q \leq n
}}
a_{i_1 \ldots i_p} b_{j_1 \dots j_q}
\,
{\underbrace{e_{i_1} \wedge \dots \wedge e_{i_p} \wedge
e_{j_1} \wedge \dots \wedge e_{j_q}}_{\text{is sometimes $0$}}}
\end{equation*}

\end{document} Note that \dots should be used throughout: it yields the right kind of dots, in these cases.

The first rendering with a bit of back spacing:

\begin{equation*}
x \wedge y =
\mspace{-9mu}
\sum_{\substack{
1 \leq i_1 < \dots < i_p \leq n \\
1 \leq j_1 < \dots < j_q \leq n
}}
\mspace{-9mu}
a_{i_1 \ldots i_p} b_{j_1 \dots j_q}
\,
{\underbrace{e_{i_1} \wedge \dots \wedge e_{i_p} \wedge
e_{j_1} \wedge \dots \wedge e_{j_q}}_{\text{is sometimes $0$}}}
\end{equation*}


Pushing the subscript further under the equals sign would introduce ambiguities. ## A different version.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

An \emph{ordered $n$-multiindex} is a finite sequence $(i_1,i_2,\dots,i_p)$, such that
$1\leq i_1<i_2<\dots<i_p\leq n.$
The set of $n$-multiindices is denoted by $M(n)$; for $I=(i_1,i_2,\dots,i_p)\in M(n)$
we also set
$e_I=e_{i_1} \wedge \dots \wedge e_{i_p}$
and note that we have actually proved that $\{e_I:I\in M(n)\}$ is a basis of the
exterior algebra $E(V)$, so any $x\in E(V)$ can be written in a unique way as
$x=\sum_{I\in M(n)}a_Ie_I$
for $a_I\in F$. Then, if $y=\sum_{J\in M(n)}b_Je_J$, we have
\begin{equation*}
x \wedge y =
\sum_{I,J\in M(n)} a_Ib_J e_I\wedge e_J
\end{equation*}
where $e_I\wedge e_J=0$ if $I$ and $J$ are not disjoint, that is, they have
some element in common.

\end{document} • Many compliments. Very nice. – Sebastiano Dec 26 '16 at 23:19
• nice answer! Could you elaborate on why not to use \smashoperator ? – gr4nt3d Dec 26 '16 at 23:33
• @hillbilly I added a solution with back spacing; compare it with the other using \smashoperator. I also added how I'd write the thing. – egreg Dec 26 '16 at 23:38
• @egreg I see the result using \mspace{-9mu}. It is just less contracted. I suppose the comment to avoid smashoperator arises just from a readability plus if more spacing is allowed ? – gr4nt3d Dec 26 '16 at 23:59
• @hillbilly: Please allow me to recommend that you adopt the notation with multiindices that egreg suggests under the title “A different version”: it is clearly superior to yours (no offense! :-) – GuM Dec 27 '16 at 0:27

I would do it this way instead:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\DeclareMathOperator*{\ssum}{\sum\sum}

\begin{document}

$\displaystyle x \wedge y = \smashoperator{\ssum_{\substack{1 \leq i_1 < \dots < i_p \leq n \\1 \leq j_1 < \dots < j_q \leq n}}} a_{i_1 \dots i_p} b_{j_1 \dots j_q} \; \underbrace{e_{i_1} \wedge \dots \wedge e_{i_p} \wedge e_{j_1} \wedge \dots \wedge e_{j_q}}_{\text{is sometimes 0}}$

\end{document} • Very nice too your answer. – Sebastiano Dec 26 '16 at 23:20
• some of those \ldots should be \cdots. (see earlier comment.) so use just \dots. (you're using amsmath, so it will do the right thing.) – barbara beeton Dec 27 '16 at 2:05
• @barbara beeton: That's right. I had noticed it but didn't touch upon the O.P.'s code. I'll fix it in a moment. – Bernard Dec 27 '16 at 10:24

I would go with the following solution:

\documentclass{article}
\usepackage{mathtools} % for "\mathclap" macro
\begin{document}
$x\wedge y = \mathop{\sum\sum}_{\mathclap{\substack{% 1\leq i_1<\dots<i_p\leq n\\[2pt] 1\leq j_1<\dots<j_q\leq n}}} a_{i_1\dots i_p} b_{j_1 \dots j_q} \dots$
\end{document}

• \mathoperator gives an error for me. – gr4nt3d Dec 26 '16 at 23:10
• @hillbilly - typo fixed. – Mico Dec 26 '16 at 23:17