[Tex/LaTex] How to place the subscript under two summation signs in a fraction

equationsmath-modesubscripts

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?

Best Answer

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

Related Question