5

Possible Duplicate:
Separate long math text under sum symbol into different lines?

I'm trying to produce a product which has two subindices. Like this:

\[ \phi_n(X)=\prod_{z\in \mu_n \\ z \textup{primitive}} (X-z) \]

That doesn't work: the \\ is not recognized.

Bruno Stonek
  • 1,321
  • 1
  • 11
  • 19

1 Answers1

4

The line break \\ doesn't work inside math like that. You can use e.g. \shortstack to stack the indices:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\[ \phi_n(X)=\prod_{\shortstack{$\scriptstyle z\in \mu_n $\\$\scriptstyle z \textup{primitive}$}} (X-z) \]

\end{document}
Martin Scharrer
  • 262,582
  • 1
    What's the difference between this and \prod_{\substack{z\in \mu_n \\ z \textup{ primitive}}} (X-z) ? – Bruno Stonek Mar 27 '11 at 17:23
  • 1
    @Bruno: I didn't now \substack before. It seems to be the better solution. The \shortstack macro is however also useful in other situations (e.g. textmode) where things have to be stacked. – Martin Scharrer Mar 27 '11 at 17:25