\input fullpage.sty
\input pst-all.sty

\def\codebaselinestretch{0.85}
\leftmargini 2em
\newdimen\mathindent
\mathindent 1em

\catcode`@=11%

\def\coursetitle{????????????????????}
\def\coursenum{???}
\def\coursesemester{???????????}
\def\courseyear{199?}
\def\handout{???????????????}

\long\def\hint#1{({\em Hint\/}: #1)}
\def\@oddfoot{}
\let\@evenfoot=\@oddfoot

\let\@@olddocument=\document

\def\document{%
\@@olddocument
\begin{center}
\thispagestyle{empty}
\vspace*{-.75in}
{\large University of New Mexico}\\
{\large Department of Computer Science}\\ [0.5in]
{\LARGE {\bf \handout}}\\ [0.1in]
{\large CS \coursenum\ \coursetitle}\\
{\large \coursesemester\ Semester, \courseyear}\\ [0.5in]
\end{center}
\let\problem\item
\let\part\item
\let\subpart\item
\makeatletter
\def\@oddhead{\rm\makebox[0in][l]{CS \coursenum---\coursesemester, \courseyear}\hfil\thepage\hfil\makebox[0in][r]{\handout}}
\let\@evenhead=\@oddhead
\makeatother
}

\newcounter{CodeLineNo}
\def\inputcoden#1{{\renewcommand{\EveryVerbatimLine}%
                         {\stepcounter{CodeLineNo}\NumberVerbatimLine}
                   \renewcommand{\EveryVerbatim}{\setcounter{CodeLineNo}{0}}%
                  \renewcommand\VerbatimFont{%
                    \renewcommand{\baselinestretch}{\codebaselinestretch}%
                    \small\tt}%
                   \VerbatimInput{#1}%
                   \renewcommand{\EveryVerbatimLine}{}}}
\def\NumberVerbatimLine{%
  \makebox[1em][r]{\tiny\red\rm\arabic{CodeLineNo}}
  \hspace{1em}}
\catcode`@=12%
