I am trying to write a formula. But both substack and array cannot fulfil my needs (as far as I know how to use them).
The first is how I want it to look like. But I need an i'\neq i
below the summation part.
The second is tried with \substack
and the third is tried with array
and both are unsatisfactory to me. Firstly, the i'\neq i
is too big. Secondly, the a_{ii'}
is misaligned.
Most preferable would be to maintain the size of the \sum
. But if that is not possible, any compromise is okay.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\sum\limits_{i=1}^{I}\sum\limits_{i'=1}^{I}a_{ii'} + \sum\limits_{i=1}^{I}b_{i}
\end{equation}
\begin{equation}
\substack{\sum\limits_{i=1}^{I}\sum\limits_{i'=1}^{I}\\i'\neq i}a_{ii'} + \sum\limits_{i=1}^{I}b_{i}
\end{equation}
\begin{equation}
\begin{array}{@{}c@{}}\sum\limits_{i=1}^{I}\sum\limits_{i'=1}^{I}\\i'\neq i \end{array}a_{ii'}+ \sum\limits_{i=1}^{I}b_{i}
\end{equation}
\end{document}
\sum_{\substack{1\le i,i'\le I\\i\ne i'}}
rather than two summation symbols.