[Tex/LaTex] \atop vs. \substack for multiple lines under a sum

amsmathmath-mode

I did a search trying to find out how one can typeset multiple lines under a sum and found out that there is the possibility to use \atop or \substack together with a remark that one shouldn't use \atop.

Is there any good reason for that? Does it commit some typographical sins I am not aware of?

Best Answer

Using \atop is abusing its functionality; if you want to turn a screw, sometimes a knife can help, but a screwdriver is surely better.

In other words, use \substack that has been specifically defined for this task and can accommodate any number of lines. It's also easier to use even for two lines.

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[
\sum_{1\le i\le n\atop i\ne j}\quad
\sum_{\scriptstyle 1\le i\le n\atop\scriptstyle i\ne j}\quad
\sum_{\substack{1\le i\le n\\ i\ne j}}
\]
\end{document}

enter image description here

The first is wrong; the second is complicated to write. With \substack you also avoid the warning

Package amsmath Warning: Foreign command \atop;
(amsmath)                \frac or \genfrac should be used instead
(amsmath)                 on input line 6.
Related Question