How to write two subscripts on top of each other in math mode?
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}