+3 votes
in General IT Tips by (39.5k points)

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 Answer

+1 vote
by (157k points)
selected by
 
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*}

Related questions

+1 vote
1 answer
+2 votes
1 answer
+1 vote
1 answer
+2 votes
1 answer

...