[Tex/LaTex] How to force equation to be closer to the sum operator

alignhorizontal alignmentmath-mode

I would like to know if it is possible to force the equation to be closer to the operation sum? When there are a lot of subscript under the sum operator, it tends to pouch the equation to the right, and this is not very aesthetic.

\sum_{n\in N_{-i}}\sum_{\substack{j \in N_{-i} \\ j \neq n}}v_j

Best Answer

The first part of following code shows the problem you mentioned and the "standard" possible solutions for a single sum: using a \makebox or using \mathclap (from the mathtools package).

Next I present your concrete example and several variations; now, only using \mathclap makes things worst since the subscripts overlap; using \mathclap and adding some space between the sums could be an option, but I think the best solution would be the last one in which the amount of symbols used in the subscripts has been reduced:

\documentclass{article}
\usepackage{mathtools}

\setlength\parindent{0pt}

\begin{document}

No special treatment (ugly):
\[
\sum_{1\leq i < j < k \leq n}a_{ijk}
\]

Using a \verb!\makebox!:
\[
\sum_{\makebox[0pt]{$\scriptstyle 1\leq i < j < k \leq n$}}a_{ijk}
\]

Using \verb!\mathclap! (requires the \texttt{mathtools} package):
\[
\sum_{\mathclap{1\leq i < j < k \leq n}}a_{ijk}
\]

Your concrete example (ugly): 
\[
\sum_{n \in N_{-i}}\sum_{\substack{j \in N_{-i} \\ j \neq n}}v_j
\]

Your concrete example using \verb!\mathclap! (uglier since scripts overlap):
 \[
\sum_{n \in N_{-i}}\sum_{\mathclap{\substack{j \in N_{-i} \\ j \neq n}}}v_j
\]

Your concrete example using \verb!\mathclap! and some space between the sums (a little better?):
 \[
\sum_{n \in N_{-i}}\mkern13mu\sum_{\mathclap{\substack{j \in N_{-i} \\ j \neq n}}}v_j
\]

Your concrete example reformulated (better, when possible):
\[
\sum_{n}\sum_{ j \neq n}v_j,
\]
where $n$ and $j$ run over $N_{-i}$.

\end{document}

output of code example

Related Question