# Lining up the equals sign on several lines of workings.

• Jul 7th 2011, 07:02 AM
Srengam
Lining up the equals sign on several lines of workings.
Hi all,

How do I get the equals sign to line up under each other like they would when writing by hand.

Example:

$\displaystyle 1000x=100y$
$\displaystyle 10x=y$

Another example:

$\displaystyle x=10-8$
$\displaystyle =2$

It would be nice if the equals were lined up.

Cheers all.
• Jul 7th 2011, 07:26 AM
Plato
Re: Lining up the equals sign on several lines of workings.
\begin{align*} \cos (2x) &= \cos^2(x)-\sin^2(x) \\ &=1-2\sin^2(x) \\ &= 2\cos^2(x)-1 \end{align*}
gives

\displaystyle \begin{align*} \cos (2x) &= \cos^2(x)-\sin^2(x) \\ &=1-2\sin^2(x) \\ &= 2\cos^2(x)-1 \end{align*}
• Jul 7th 2011, 11:11 AM
Srengam
Re: Lining up the equals sign on several lines of workings.
Hi there,

I had a little trouble getting your method to work for me. I was however able to achieve it using the tabbing environment. Once I get a bit better with LaTeX I will return to your suggested method, but for now I can carry on with the tabbing method.

Many thanks.
• Jul 7th 2011, 11:21 AM
Plato
Re: Lining up the equals sign on several lines of workings.
Quote:

Originally Posted by Srengam

$\displaystyle 1000x=100y$
$\displaystyle 10x=y$

Another example:
$\displaystyle x=10-8$
$\displaystyle =2$

\begin{align*} 1000x &= 100y \\ 10x &=y\end{align*}
\displaystyle \begin{align*} 1000x &= 100y \\ 10x &=y\end{align*}

\begin{align*} x &= 10-8 \\ &=2\end{align*}
\displaystyle \begin{align*} x &= 10-8 \\ &=2\end{align*}