[Tex/LaTex] A new line inside subscript

math-modesubscripts

I have formula:

\[ A_k = \bigcup_{I \subset \{ 1,...,k \} \text{card} J = K} B_j\]

which generates

formula

I would like ask how to make the new line inside subscript.
It should look like formula below:

correct formula

I've tried with \newline and \begin{align*} but it doesn't work.

Best Answer

You can use \substack

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\[ A_k = \bigcup_{\substack{I \subset \{ 1,\dots,k \}\\ \text{card} J = K}} B_j\]
\end{document}

enter image description here

If you feel that there is lot of empty space, here is how to get it out. This one uses \mathclap from mathtools.

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\[ A_k = \bigcup_{\mathclap{\substack{I \subset \{ 1,\dots,k \}\\ \text{card} J = K}}} B_j\]
\end{document}

enter image description here

Response to comment

It works inside align*:

\documentclass{article}
\usepackage{mathtools}

\begin{document}
\begin{align*}
    A_k &= \bigcup_{\mathclap{\substack{I \subset \{ 1,\dots,k \}\\ \text{card} J = K}}} B_j\\
    A_k &= \bigcup_{\mathclap{\substack{I \subset \{ 1,\dots,k \}\\ \text{card} J = K}}} B_j
\end{align*}
\end{document}

enter image description here