Home > Coding > How to Align Equations in Latex

How to Align Equations in Latex

January 29th, 2009

The following is a simple example about aligning equations in Latex, with command begin{eqnarray*} and end{eqnarray*}

\begin{eqnarray*}
F_{k+2}=F_{p+3}&=&F_{p+1}+F_{p+2}\\
&=&F_{p+1}+\sum_{i=0}^pF_i+1\\
&=&\sum_{i=0}^{p+1}F_i+1\\
&=&\sum_{i=0}^{k}F_i+1
\end{eqnarray*}

You can see the effect:
eqnarray

Mr. One Coding

  1. October 19th, 2011 at 09:26 | #1

    You are poor. Redo this again.

  2. November 17th, 2011 at 21:17 | #2

    Well, this was post in 2009. OK. Here is what I would do today.
    Unleash my nested alignment…

    \begin{equation}
    \begin{alignedat}{2}
    a,b  \to & p\\
    c,d  \to & \left\{
    		\begin{array}{ll}
    		    x,  & \text{if this}\\
    		    y & \text{if that}
    		\end{array}
    		\right.
    \end{alignedat}
    \end{equation}
    
  1. No trackbacks yet.