tags:

views:

132

answers:

3

hi all i need to write the next formula in latex, but i can't put it in multiple lines and with the right indentation for the subsequent lines, this is my code.

\begin{displaymath}
\pi_D^B(r) = \{z^{(|D|+1)}|\exists x \in r(z[D]=x[D])\wedge \\
             \forall y \in r (y[D]=z[D]\Rightarrow y[T]\subseteq z[T])\wedge \\
             \forall y \in z[T \exists y \in r (y[D]=z[D]\wedge t \in  y[T])\}
\end{displaymath}
+3  A: 

Use the align environment from the amsmath package:

\begin{align}
 \pi_D^B(r) = &\{z^{(|D|+1)}|\exists x \in r(z[D]=x[D])\wedge \\
              &\forall y \in r (y[D]=z[D]\Rightarrow y[T]\subseteq z[T])\wedge \\
              &\forall y \in z[T \exists y \in r (y[D]=z[D]\wedge t \in  y[T])\}
\end{align}
David Zaslavsky
+1  A: 

Since displaymath is not numbered perhaps you prefer the align* environment instead of align. Note, usually the & symbol is used before a relation symbol for the alignment.

For more information look at one of the documents listed here: Mathematics with LaTeX.

Stefan

Stefan
A: 

One solution is to use eqnarray or better eqnarray* to avoid equation labels.

\begin{eqnarray*} 
\pi_D^B(r)  & = & \{z^{(|D|+1)}|\exists x \in r(z[D]=x[D])\wedge \\ 
            &   & \forall y \in r (y[D]=z[D]\Rightarrow y[T]\subseteq z[T])\wedge \\ 
            &   & \forall y \in z[T \exists y \in r (y[D]=z[D]\wedge t \in  y[T])\} 
\end{eqnarray*} 
pass
Please avoid eqnarray. Just [google eqnarray](http://www.google.com/search?q=eqnarray) — several of the top results are about why you should avoid it.
ShreevatsaR