# How to align 'implies that' symbols neatly in equation array

The following is an equation array I have:

\begin{eqnarray}
\Rightarrow\eta_t &=& \eta_x(\omega \eta-(\varphi_x)_s) + (\varphi_y)_s\notag\\
\Rightarrow\eta_t\,(\varphi_y)_s &=& \eta_x(\omega \eta-(\varphi_x)_s)(\varphi_y)_s +      {(\varphi_y)_s}^2\notag\\
&=&\omega\, \eta\,(\varphi_y)_s\, \eta_x-(\varphi_x)_s\, \eta_x(\varphi_y)_s +     {(\varphi_y)_s}^2.
\end{eqnarray}


All I want to do is move the first 'implies that' symbol so that it is aligned with the second one and to not change anything else. I have tried several things but the end result is always that the equations are stretched out and I want to avoid that. (I know use of eqnarray is not recommended but I've done too much to go back and change everything!!)

-
Never ever use eqnarray; see this answer and the links in it –  egreg Feb 26 at 14:10

Note that you only need two alignment points. (Also, Avoid eqnarray!.)

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
&\eta_{t}
&= \eta_{x}(\omega\eta - (\varphi_{x})_{s}) + (\varphi_{y})_{s}\notag\\
&\Rightarrow
&\eta_t(\varphi_{y})_{s}
&= \eta_{x}(\omega\eta - (\varphi_{x})_{s})(\varphi_{y})_{s} + {(\varphi_{y})_{s}}^{2}\notag\\
&&&= \omega\eta(\varphi_{y})_{s}\eta_{x} - (\varphi_{x})_{s}\eta_{x}(\varphi_{y})_{s} + {(\varphi_{y})_{s}}^{2}.
\end{alignat}

\end{document}


Update

I think you have one arrow too many. Either way, here are one version with a single horizontal arrow and another version with a single vertical arrow:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{alignat}{2}
&&\eta_{t}
&= \eta_{x}(\omega\eta - (\varphi_{x})_{s}) + (\varphi_{y})_{s}\notag\\
&\eta_t(\varphi_{y})_{s}
&= \eta_{x}(\omega\eta - (\varphi_{x})_{s})(\varphi_{y})_{s} + {(\varphi_{y})_{s}}^{2}\notag\\
&&&= \omega\eta(\varphi_{y})_{s}\eta_{x} - (\varphi_{x})_{s}\eta_{x}(\varphi_{y})_{s} + {(\varphi_{y})_{s}}^{2}.
\end{alignat}
or
\begin{alignat}{2}
&&\eta_{t}
&= \eta_{x}(\omega\eta - (\varphi_{x})_{s}) + (\varphi_{y})_{s}\notag\\
\ArrowBetweenLines[\Downarrow]
&&\eta_t(\varphi_{y})_{s}
&= \eta_{x}(\omega\eta - (\varphi_{x})_{s})(\varphi_{y})_{s} + {(\varphi_{y})_{s}}^{2}\notag\\
&&&= \omega\eta(\varphi_{y})_{s}\eta_{x} - (\varphi_{x})_{s}\eta_{x}(\varphi_{y})_{s} + {(\varphi_{y})_{s}}^{2}.
\end{alignat}

\end{document}


-

Avoid eqnarray; it produces awful spacing. See this answer and the links in it titled “Avoid eqnarray!”.

If you want a unique equation number, I suggest to use alignedat inside equation, which will vertically center the equation number.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{alignedat}{2} \Rightarrow\quad && \eta_t &= \eta_x(\omega \eta-(\varphi_x)_s) + (\varphi_y)_s \\ \Rightarrow\quad && \eta_t\,(\varphi_y)_s &= \eta_x(\omega \eta-(\varphi_x)_s)(\varphi_y)_s+(\varphi_y)_s^2 \\ && &= \omega\eta(\varphi_y)_s\eta_x-(\varphi_x)_s\eta_x(\varphi_y)_s+(\varphi_y)_s^2. \end{alignedat}

\end{document}


Some points to note.

1. There's no need of \, in the last line

2. Typing {(\varphi_x)_s}^2 sets the exponent like it was hanging from nowhere. I'd simply use (\varphi_x)_s^2 that's clear as well.

-

Given that you are using \notag you must have loaded the amsmath package. In that case, you may well have seen that the amsmath environments are to be strongly preferred over eqnarray. In this case you can use alignat:

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{alignat}{3}
\eta_t &= \eta_x(\omega \eta-(\varphi_x)_s) + (\varphi_y)_s\notag\\
\Rightarrow&&
\eta_t\,(\varphi_y)_s &= \eta_x(\omega
\eta-(\varphi_x)_s)(\varphi_y)_s + {(\varphi_y)_s}^2\notag\\
&&&=\omega\, \eta\,(\varphi_y)_s\, \eta_x-(\varphi_x)_s\,
\eta_x(\varphi_y)_s + {(\varphi_y)_s}^2.
\end{alignat}
\end{document}


An alternative is to use the eqnarray package and its equationarray environment, where you can specify alignment of columns and get a syntax much as in eqnarray:

\documentclass{article}

\usepackage{amsmath,eqnarray}

\begin{document}

\begin{equationarray}{rrcl}
\Rightarrow&
\eta_t &=& \eta_x(\omega \eta-(\varphi_x)_s) + (\varphi_y)_s\notag\\
\Rightarrow&
\eta_t\,(\varphi_y)_s &=& \eta_x(\omega
\eta-(\varphi_x)_s)(\varphi_y)_s + {(\varphi_y)_s}^2\notag\\
&&=&\omega\, \eta\,(\varphi_y)_s\, \eta_x-(\varphi_x)_s\,
\eta_x(\varphi_y)_s + {(\varphi_y)_s}^2.
\end{equationarray}
\end{document}

-

You can do it with a TABstack. The interline gap can be set with the commented out \setstackgap{S}{} line (default 3pt). The gap to the right of the \Rightarrow can be set with the commented out \setstackaligngap line (default 1em = \quad).

\documentclass{article}
\usepackage{tabstackengine}
\stackMath
\begin{document}
%\setstackgap{S}{3pt} %\setstackaligngap{1em} \alignShortstack{ \Rightarrow&&\eta_t =& \eta_x(\omega \eta-(\varphi_x)_s) + (\varphi_y)_s\\ \Rightarrow&&\eta_t\,(\varphi_y)_s =& \eta_x(\omega \eta-(\varphi_x)_s)(\varphi_y)_s + {(\varphi_y)_s}^2\\ &&=&\omega\, \eta\,(\varphi_y)_s\, \eta_x-(\varphi_x)_s\, \eta_x(\varphi_y)_s + {(\varphi_y)_s}^2. }
\end{document}


-