# ConTeXt equivalent of AMSmath's \substack

The Plain TeX

$$\sum_{i \in S \atop j \in T} i$$


seems to be usually typeset mathematically in LaTeX using the \substack macro from the AMS maths macros (accessed using \usepackage{amsmath})

$\sum_{\substack{i \in S\\ j \in T}} i$


which gives slightly different results, most importantly in that the subscripts are scriptsized in the latter, but scriptscriptsized in the former.

Results like these can be obtained in ConTeXt using matrices, e.g.:

\def\scriptsize{\switchtobodyfont[7pt]}
\startformula
\sum_{\startmathmatrix
\NC \scriptsize i \in S \NR
\NC  \scriptsize i \in T \NR
\stopmathmatrix}
i
\stopformula


But this is clunky (not to mention my code above giving ugly spacing) and defining a macro to do this risks being ad hoc. Is there an attractive and idiomatic way to do this in ConTeXt? I'd be most interested in a reasonably well-established way of translating AMS maths into ConTeXt.

-

You can use \startsubstack … \stopsubstack. The mathalign manual for a more detailed description and examples of this command.

\starttext
\startformula
\sum_{\startsubstack
i \in S \NR
i \in T \NR
\stopsubstack
}i
\stopformula
\stoptext

-
Good - that looks much better. It's funny that searching the contextgarden.net wiki for substack did not come up with that. –  Charles Stewart Dec 10 '12 at 14:33
Feel free to improve it, it's wiki! –  Marco Dec 10 '12 at 15:18
I've created a stub: wiki.contextgarden.net/Command/startsubstack . Be cool if somebody could add a description, possibly expand the See Alsos. –  Esteis Dec 11 '12 at 12:07