Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question

marked as duplicate by Caramdir, Martin Scharrer Mar 27 '11 at 18:43

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3  
See if tex.stackexchange.com/questions/12344 explains what you need. –  Andrey Vihrov Mar 27 '11 at 17:15
    
Wonderful, that's exactly what I needed. I guess I didn't search using the correct terms. Thanks! –  Bruno Stonek Mar 27 '11 at 17:18
    
If the above linked question solved your problem this question should be closed as duplicate. I can do that if you don't mind. –  Martin Scharrer Mar 27 '11 at 17:58
add comment

1 Answer

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}
share|improve this answer
    
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
    
@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
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.