\documentclass{article}

\usepackage{amsmath}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\title{Latex template for theory courses at OSU}
\author{Glencora Borradaile}

\begin{document}
\maketitle

\begin{theorem}
  The latex package {\em amsthm} makes defining mathematically
  enviroments easy.
\end{theorem}

\begin{proof}
  In the preamble,
\begin{verbatim} 
\newtheorem{theorem}{Theorem}
\end{verbatim}
  defines the theorem environment.  amsthm also has a built in proof
  environment.
\end{proof}

There are many packages for defining pseudocode, but my favourite is
the very simple tabbing environment, illustrated here:

\begin{tabbing}
  {\sc SumOfNumbers}$(n)$\\
  \qquad \= $x = 0$ \\
  \> for $i = 1, \ldots, n$\\
  \> \qquad \= $x = x+i$\\
  \> return $x$
\end{tabbing}

Formulae can be set within a line such as this: $f(x,y) = (x+y)(x-y)$
or set out as in Equation~(\ref{eq:1}).
\begin{equation}
  \label{eq:1}
  f(x,y) = (x+y)(x-y)
\end{equation}
Here is an unnumbered multi-line formula:
\begin{eqnarray*}
  \label{eq:2}
  f(x,y) &= & (x+y)(x-y) \\
  & = & x(x-y) + y(x-y) \\
  & = & x^2 - xy + xy - y^2 \\
  & = & x^2-y^2
\end{eqnarray*}

\end{document}
