Formatting – How to Centre Substack in Multiple Summations

formatting

This seems like it would be easy to do so pardon my inexperience but is it possible to centre a secondary line such that it is between both sums, whether using substack or by other means.

I currently have:

Thanks in advance!

Best Answer

You can use stackengine to achieve it, though the space before the a_{ij} must be manually inserted. I show the standard expression (without the secondary subscript) to compare the spacing.

\documentclass{article}
\usepackage{stackengine}
\stackMath
\begin{document}
\[
\sum_{j=1}^N \sum_{k=1}^N a_{ij}
\]
\[
\stackunder[0pt]{\displaystyle\sum_{j=1}^N \sum_{k=1}^N}
  {\scriptstyle i\ne j\ne k}\,a_{ij}
\]
\end{document}

enter image description here

Related Question