0

I wrote an equation with 3 products involved and it doesn't seem that they want to be written in one line (pic related). My code looks like this:

\begin{center}  
$\psi$ =   
$$\prod_{i=1}^{x}$$ $\times$   
$$\prod_{i=1}^{y}$$ $\times$   
$$\prod_{i=1}^{z}$$   
\end{center}

I am new to Latex and I don't know what I did wrong. enter image description hereThanks for your help!

  • 3
    Everything between every first $$ and the next $$ will be a displayed equation in a line of its own. That's how TeX works. If you want the product symbols in the same line, put them all between the same $$...$$ pair: $$\prod_{i=1}^{x} \times \prod_{i=1}^{y}$$. And don't use \begin{center}...\end{center} there. – Phelype Oleinik Mar 08 '19 at 22:18
  • 1
    Also have a look here: https://tex.stackexchange.com/a/179052/120578 – koleygr Mar 08 '19 at 22:24
  • Thank you, it's fixed now! – DirtyJacket Mar 08 '19 at 22:35

1 Answers1

2

It looks like you're trying to typeset a displayed equation, i.e., an equation on a row by itself. If that's the case, you should be writing

\[ 
\psi = \prod_{i=1}^{x} \times \prod_{i=1}^{y} \times \prod_{i=1}^{z}   
\]

The \[ and \] directives serve to initiate and terminate display math mode. Observe that there aren't any $ or $$ directives between \[ and \].

Mico
  • 506,678