4

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.

1 Answer 1

6

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
3
  • Good - that looks much better. It's funny that searching the contextgarden.net wiki for substack did not come up with that. Commented Dec 10, 2012 at 14:33
  • Feel free to improve it, it's wiki!
    – Marco
    Commented Dec 10, 2012 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
    Commented Dec 11, 2012 at 12:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .