I am using the * amsmath *package to write equations in my latex document. But the equations are not aligned. How can I align them?

+1 vote

Best answer

You can use \begin{split} and \end{split} inside the equation. Use the ampersand character &, to set the points where the equations are vertically aligned.

\begin{equation}

\begin{split}

A & = \frac{\pi r^2}{2} \\

B & = \frac{1}{2} \pi r^2

\end{split}

\end{equation}

You can also put your equations inside \begin{align} and \end{align} to align them vertically.

\begin{align*}

x - 4y &= 18 \\

2x + 7y &= -22

\end{align*}