# Aligning two different (\iff symbol, and =) in an equatation

So this was my code:

\begin{align*}
\iff&& \frac{1}{x}=&\frac{x}{1-x}\\
\iff&& 1-x=&x^2\\
\iff&& 0=&x^2+x-1
\end{align*}


Everything worked as expected except the first line, which for some reason decided to hate me. Any ideas?

• (1) welcome, (2) please post a full minimal example, nut just sniplets, that makes it a lot easier to help – daleif Nov 3 '17 at 15:11

You forgot && for the first line.

I suggest alignat, though, in order to have less blank space between the arrows and the equations.

You should use &= and not =&.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{alignat*}{2}
&=\frac{\lvert\overline{DC}\rvert}{\lvert\overline{CE'}\rvert}\\
\iff&& \frac{1}{x}&=\frac{x}{1-x}\\
\iff&& 1-x&=x^2\\
\iff&& 0&=x^2+x-1
\end{alignat*}

\end{document}


On the other hand, I'd not align the = signs.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align*}