# Environment align undefined line 11, all I can see to do is to retype the line and it still isn't working

\documentclass [12pt]{article}
\oddsidemargin=0pt
\topmargin=0pt
\textwidth=6.5in
\textheight=8.5in
\begin{document}
\begin{center}
{\large\bf\LaTeX\ Example 8}
\end{center}
Sometimes we have to typeset a sequence of calculations:
\begin{align}
\sum_{r=1}^k\left( l(r)-l(r-1)\right)
&= \sum_{r=1}^k\left(N-2r+1\right) \\
&= k(N+1)-2\sum_{r=1}^kr \\
&= k(N+1)-k(k+1) \\
&= k(N-k)
\end{align}
\begin{quote}
\begin{verbatim}
\begin{align}
\sum_{r=1}^k\left( l(r)-l(r-1)\right)
&= \sum_{r=1}^k\left(N-2r+1\right) \\
&= k(N+1)-2\sum_{r=1}^kr \\
&= k(N+1)-k(k+1) \\
&= k(N-k)
\end{align}
\end{verbatim}
\end{quote}
Here is another way:
\begin{eqnarray*}
\sum_{r=1}^k\left(l(r)-l(r-1)\right)
&=& \sum_{r=1}^k\left(N-2r+1\right) \\
&=& k(N+1)-2\sum_{r=1}^kr \\
&=& k(N+1)-k(k+1) \\ &=& k(N-k)
\end{eqnarray*}
\begin{quote}
\begin{verbatim}
\begin{eqnarray*}
\sum_{r=1}^k\left(l(r)-l(r-1)\right)
&=& \sum_{r=1}^k\left(N-2r+1\right) \\
&=& k(N+1)-2\sum_{r=1}^kr \\
&=& k(N+1)-k(k+1) \\ &=& k(N-k)
\end{eqnarray*}
Observations:
\begin{itemize}
\item The eqnarray environment is a displayed array with three columns.  It is aligned on
the center column.
\item The \verb+*+ supresses the generation of equation numbers.
\end {itemize}
---Britney Wiggins
\end{document}

-
Add the amsmath package in your preamble and do not forget to end the verbatim and quote environments at the end. – Ludovic C. Sep 6 '13 at 7:59
Use »geometry« to specify the paper and page dimensions. – Thorsten Donig Sep 6 '13 at 9:49
Sorry to bother you. Don't forget that you can accept answers (that you consider solved your problems) by clicking the checkmark to the left of the answer. In case of doubt, please see How do you accept an answer?. – Gonzalo Medina Sep 6 '13 at 13:40

\usepackage{amsmath}


is needed to use the math environments align, aligned, gather, gathered, multline etc.

-
Furthermore the quote and the verbatim environments for the second example are not closed which leads to an error too. – Ludovic C. Sep 6 '13 at 8:02

First of all, in order to use align environment, you need to load amsmath (or mathtools) package at the beginning. Second, you'll want to close your verbatim and quote environments by adding corresponding commands at appropriate places. Third, \bf is an obsolete command now, try use \bfseries instead.

Here is fixed code:

\documentclass[12pt]{article}
\oddsidemargin=0pt
\topmargin=0pt
\textwidth=6.5in
\textheight=8.5in

\usepackage{mathtools}

\begin{document}
\begin{center}
{\large\bfseries\LaTeX\ Example 8}
\end{center}
Sometimes we have to typeset a sequence of calculations:
\begin{align}
\sum_{r=1}^k\left( l(r)-l(r-1)\right)
&= \sum_{r=1}^k\left(N-2r+1\right) \\
&= k(N+1)-2\sum_{r=1}^kr \\
&= k(N+1)-k(k+1) \\
&= k(N-k)
\end{align}
\begin{quote}
\begin{verbatim}
\begin{align}
\sum_{r=1}^k\left( l(r)-l(r-1)\right)
&= \sum_{r=1}^k\left(N-2r+1\right) \\
&= k(N+1)-2\sum_{r=1}^kr \\
&= k(N+1)-k(k+1) \\
&= k(N-k)
\end{align}
\end{verbatim}
\end{quote}
Here is another way:
\begin{eqnarray*}
\sum_{r=1}^k\left(l(r)-l(r-1)\right)
&=& \sum_{r=1}^k\left(N-2r+1\right) \\
&=& k(N+1)-2\sum_{r=1}^kr \\
&=& k(N+1)-k(k+1) \\ &=& k(N-k)
\end{eqnarray*}
\begin{quote}
\begin{verbatim}
\begin{eqnarray*}
\sum_{r=1}^k\left(l(r)-l(r-1)\right)
&=& \sum_{r=1}^k\left(N-2r+1\right) \\
&=& k(N+1)-2\sum_{r=1}^kr \\
&=& k(N+1)-k(k+1) \\ &=& k(N-k)
\end{eqnarray*}
\end{verbatim}
\end{quote}
Observations:
\begin{itemize}
\item The eqnarray environment is a displayed array with three columns.  It is aligned on
the center column.
\item The \verb+*+ supresses the generation of equation numbers.
\end {itemize}
---Britney Wiggins

\end{document}

-
And using the geometry package is prefered to setting the layout manually. – daleif Sep 6 '13 at 9:09
Thank you everyone, \usepackage{amsmath} worked best for me. – Britney Wiggins Sep 6 '13 at 14:28