Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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!!)

share|improve this question
1  
Never ever use eqnarray; see this answer and the links in it –  egreg Feb 26 at 14:10

4 Answers 4

up vote 3 down vote accepted

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

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{alignat}{2}
  &\Rightarrow\quad
  &\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}

output

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\\
  &\Rightarrow\quad
  &\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}

output2

share|improve this answer

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:

Sample output

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{alignat}{3}
  \Rightarrow&\quad&
  \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:

equationarry sample

\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}
share|improve this answer

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}
\begin{equation}
%\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{equation}
\end{document}

enter image description here

share|improve this answer

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{equation}
\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{equation}

\end{document}

enter image description here

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.