Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

New lines in displaymath LaTeX

Tags:

math

latex

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}
like image 662
mjsr Avatar asked Dec 22 '22 01:12

mjsr


2 Answers

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}
like image 166
David Z Avatar answered Dec 31 '22 14:12

David Z


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

like image 21
Stefan Avatar answered Dec 31 '22 14:12

Stefan