Large operators\substack

\substackCommand

Stacking short expressions on multiple lines, typically inside subscripts, superscripts, or under limit operators.

\substack{a\\b}
Available in
ams
Kind
prefix
Allowed mode
math
Frequency
0.62% of corpus formulasrank 57 of 263
Commonality
medium
Renderer support
PackageMathJaxKaTeXXeTeX
amsMathJax: FullKaTeX: FullXeTeX: Full
About the test scope

Syntax#

\substackm{a}math content

Argspec m — one mandatory argument. Reading argspecs

Common tasks#

How to write a two-line subscript on a sum#

\sum_{\substack{i=1\\i\neq j}}^n a_{ij}

How to write several constraints under a max#

\max_{\substack{x\ge 0\\ \|x\|_1=1}} f(x)

How to stack conditions under a union#

\bigcup_{\substack{n\in\mathbb{N}\\ n\text{ odd}}} A_n

In TeXForm#

TeXForm parses this entry as prefix syntax; the package determines its argument specification.

Expands to#

\substack{#1} \begin{subarray}{c}#1\end{subarray}

The replacement hardcodes a single centered column and reparses the body as subarray content.

ams/substack-expandfrom Faithfulrender

Expand substack directly to the explicit centered subarray environment.

\substack{#1\\#2} \begin{subarray}{c}#1\\#2\end{subarray}

See also#

Test cases#

ams
InputCaseMathJaxKaTeXXeTeX
\substack{a}Positive · baselinePassPassPass
\substack aPositive · bare[0]PassPassPass
All 5 in Large operators