I want to write something like
Q_{a\in A,b\in B}
but with $b\in B$ being below $a \in A$. What is the way to do so?
Use \substack
:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[ Q_{\substack{a\in A\\b\in B}} \]%
\end{document}
Use the \genfrac
command from the amsmath package.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
Q_{\genfrac{}{}{0pt}{}{a\in A}{b\in B}}
\end{equation*}
\end{document}
Using align
enviroment:
\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\begin{document}
$Q_{\begin{aligned}
\scriptscriptstyle a & \scriptscriptstyle\in A\\[-1em]
\scriptscriptstyle b & \scriptscriptstyle\in B
\end{aligned}}$
\end{document}
$Q_{a\in A}^{b\in B}$
?