New lines in displaymath LaTeX

I need to write the following formula in LaTeX, but I canโ€™t put it on several lines and with the right indent for the next 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} 
+4
source share
4 answers

Since displaymath is not numbered, you might prefer alignment * rather than alignment. Please note: this is usually the symbol and is used before the relation symbol for alignment.

For more information, see one of the documents listed here: Mathematics with LaTeX .

Stephen

+4
source

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} 
+6
source

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

 \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*} 
0
source

Again, you can nest the split environment (from the amsmath package) in your displaymath :

 \documentclass{article} \usepackage{amsmath} \begin{document} \begin{displaymath} \begin{split} \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{split} \end{displaymath} \end{document} 

screenshot

I think you should fix z[T \exists in the last line.

0
source

Source: https://habr.com/ru/post/1316035/


All Articles