3

I would like to place a subscript under two summation signs in a fraction, in an equation. The code showed works when it is not in a fraction, but as soon as I use it in a fraction the subscript is placed after the two summation signs, instead of under the two summation signs.

\begin{equation} \frac{{\sum\sum\limits}_{i \neq j}
    \sum\limits_{x}\sum\limits_{y}[\pi_{x(i),y(j)} -
    \pi_{x(i)}\pi_{y(j)}]} {\sigma^2_X} 
\end{equation}

Does anyone know how to solve this?

1047
  • 101

2 Answers2

10

You need to enclose the two summation symbols in \mathop{} and then place \limits after that.

\documentclass{article}
\begin{document}

\begin{equation}
  \frac{\mathop{\sum\sum}\limits_{i \neq j}
    \sum\limits_{x}\sum\limits_{y}[\pi_{x(i),y(j)} -
    \pi_{x(i)}\pi_{y(j)}]}{\sigma^2_X} 
\end{equation}

\end{document}

enter image description here

Henri Menke
  • 109,596
2

If you use lualatex, you can place the \limits outside of the braces:

{\sum\sum}\limits_{i\neq j}

However, this will throw an error if compiled with pdflatex or xelatex, then you need a \mathop:

\mathop{\sum\sum}\limits_{i\neq j}

If you need this more often, you can define a new mathoperator (needs amsmath), if you use the starred Version, the default is the use of \limits.

\DeclareMathOperator*{\ssum}{\sum\sum}

If you are inside a \frac, displaymode is turned of, you can switch it back on:

\begin{equation}
  \frac{\displaystyle \ssum_{i\neq j}}{2}
\end{equation}
MaxNoe
  • 6,136