# How to add equivalent symbols to equations

I am trying to change from

to this

Here is my code:

    \begin{align*}
\smash[b]{\underbrace{\overline{xx\cdots x}}_\text{$2n$}}-\smash[b]{\underbrace{\overline{yy\cdots y}}_\text{$n$}}
& = (\overline{\underbrace{zz\cdots z}_{n}})^2  \\
\dfrac{x(10^{2n}-1)}{9} - \dfrac{y(10^n-1)}{9}
& = \dfrac{z^2(10^n-1)^2}{9^2}\\9x(10^n+1) - 9y
& = z^2(10^n-1)\\9x \cdot 10^n + (9x-9y)
& = z^2 \cdot 10^n - z^2
\end{align*}

• Please, make your code snipped compilable. As it is now, it can produce equation which you show. By the way, is \Leftrightarrow what you looking for? Or you like to have \equiv? – Zarko May 11 '16 at 0:59
• @Zarko I am talking about \iff. – user19405892 May 11 '16 at 1:01

Maybe this.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{alignat*}{4}
\smash[b]{\underbrace{\overline{xx\cdots x}}_\text{$2n$}}-\smash[b]{\underbrace{\overline{yy\cdots y}}_\text{$n$}} & = (\overline{\underbrace{zz\cdots z}_{n}})^2  \\
\Leftarrow\kern-4pt\Rightarrow&&
\dfrac{x(10^{2n}-1)}{9} - \dfrac{y(10^n-1)}{9}
& = \dfrac{z^2(10^n-1)^2}{9^2}\\
\Leftarrow\kern-4pt\Rightarrow&&
9x(10^n+1) - 9y
& = z^2(10^n-1)\\
\Leftarrow\kern-4pt\Rightarrow&&
9x \cdot 10^n + (9x-9y)
& = z^2 \cdot 10^n - z^2
\end{alignat*}
\end{document}


As Zarko notes, the amspackage also provides a macro \Leftrightarrow that is double-headed and double-lined. It is, however, quite a bit narrower than the self-composed one I provided above with \Leftarrow\kern-4pt\Rightarrow.

• Is there special reason that you not use \Leftrightarrow as provided by amsmath and rather compose it? – Zarko May 11 '16 at 1:15
• @Zarko I don't use it enough to recall its existence, though perhaps I should edit. – Steven B. Segletes May 11 '16 at 1:18
• @Zarko I just took a look, and it looks quite short. Best I could tell, it was not extensible, either. – Steven B. Segletes May 11 '16 at 1:20
• To be honest, I use WinEdt and in similar situations looks in it collected amsmath simbols :-) – Zarko May 11 '16 at 1:20
• @Zarko I added a notation to my answer, citing your comment. Thanks. – Steven B. Segletes May 11 '16 at 1:23

You also can try \ArrowBetweenLines from mathtools:

\documentclass[a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}

\begin{document}

\begin{alignat*}{2}
&  &  \smash[b]{\underbrace{\overline{xx\cdots x}}_\text{$2n$}}-\smash[b]{\underbrace{\overline{yy\cdots y}}_\text{$n$}}
& = (\overline{\underbrace{zz\cdots z}_{n}})^2 \\
\ArrowBetweenLines
&  & \dfrac{x(10^{2n}-1)}{9} - \dfrac{y(10^n-1)}{9} & = \dfrac{z^2(10^n-1)^2}{9^2}\\%
\ArrowBetweenLines
&  & 9x(10^n+1) - 9y   & = z^2(10^n-1)\\
\ArrowBetweenLines
&  & 9x \cdot 10^n + (9x-9y) & = z^2 \cdot 10^n - z^2
\end{alignat*}

\end{document}
`