Wednesday, October 19, 2011

Latex: how to number your equation at any line


1. Number each line


\begin{align}
\label{equ:example}
D_{o_1o_2}&(t) =  ((v_{x_1}-v_{x_2})^2+(v_{y_1}-v_{y_2})^2) \cdot t^2
\\  & + \left( (x_1-x_2)(v_{x_1}-v_{x_2})+(y_1-y_2)(v_{y_1}-v_{y_2}) \right )\cdot 2t
\\  & +(x_1-x_2)^2+(y_1-y_2)^2
\end{align}


2. Number one line

\begin{align}
\label{equ:example}
\notag D_{o_1o_2}&(t) =  ((v_{x_1}-v_{x_2})^2+(v_{y_1}-v_{y_2})^2) \cdot t^2
\notag \\  & + \left( (x_1-x_2)(v_{x_1}-v_{x_2})+(y_1-y_2)(v_{y_1}-v_{y_2}) \right )\cdot 2t
\notag \\  & +(x_1-x_2)^2+(y_1-y_2)^2
\end{align}

3. No numbering

\begin{align*}
\label{equ:example}
 D_{o_1o_2}&(t) =  ((v_{x_1}-v_{x_2})^2+(v_{y_1}-v_{y_2})^2) \cdot t^2 
\\  & + \left( (x_1-x_2)(v_{x_1}-v_{x_2})+(y_1-y_2)(v_{y_1}-v_{y_2}) \right )\cdot 2t 
\\  & +(x_1-x_2)^2+(y_1-y_2)^2
\end{align*}

No comments:

Post a Comment