I'm not convinced this is a good idea but you could do something like
\documentclass{article}
\usepackage{amsmath}
\renewcommand\sb[1]{_\text{$#1$}}
\begin{document}
\[
\sum_{i = 1}^{n} a_{i}
\]
\[
\sum\sb{i = 1}^{n} a_{i}
\]
\end{document}
Here I've redefined the standard command \sb
which by default does the same as _
, you could go further and redefine _
but history shows that if you do that usually you end up breaking something.
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}
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}
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}
Best Answer
That is expected; it's a matter of inline math mode versus display math mode.
Inline math is meant for small fragments inside the running text, so it is typeset in a compact way, with the subscript to the side of the sum symbol. Inline math is done with
$...$
.Display math is meant for larger, standalone equations, and is set in a paragraph of its own. Because it has more space, the subscript can be put underneath the sum symbol. Display math is done with
\[...\]
or a whole variety of environments.