# Aligning formulae in LaTeX

\forall x\    &0 \neq S(x)\\
\forall x,y\  &S(x) = S(y) \implies x = y\\
\forall x\    &x + 0 = x\\
\forall x,y\  &x + S(y) = S(x + y)\\
\forall x\    &x \cdot 0 = 0\\
\forall x,y\  &x \cdot S(y) = x \cdot y + x


I want to align the above formulae such as displayed in the plain text.

How can I do that in LaTeX?

• Please provide a minimal working example. It looks like you are trying to align by using ampersands (&) but because you've not provided any more code, I can't see what you have tried. Are you using align or a table for example? – JJAD Apr 25 '17 at 18:37
• @JJAD I tried using the align environment but it did not work. – Jsevillamol Apr 25 '17 at 18:42

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{alignat*}{2}
& \forall  x\ &&0 \neq S(x)\\
&\forall x,y\ &&S(x) = S(y) \implies x = y\\
&\forall   x\ &&x + 0 = x\\
&\forall x,y\ &&x + S(y) = S(x + y)\\
&\forall   x\ &&x \cdot 0 = 0\\
&\forall x,y\ &&x \cdot S(y) = x \cdot y + x
\end{alignat*}
\end{document}

• Mentioning \  on a single (relevant) line should yield the result as well. – Bernard Apr 25 '17 at 20:18
\begin{math}
\begin{array}{ll}
\forall x\    &0 \neq S(x)\\
\forall x,y\  &S(x) = S(y) \implies x = y\\
\forall x\    &x + 0 = x\\
\forall x,y\  &x + S(y) = S(x + y)\\
\forall x\    &x \cdot 0 = 0\\
\forall x,y\  &x \cdot S(y) = x \cdot y + x
\end{array}
\end{math}

• ...interesting... \begin{math}...\end{math}... – Werner Apr 25 '17 at 18:58