% handout article class
% To be invoked as, for example, \documentclass{handout}

% Last updated 14 September 1995 by dmj

\ProvidesClass{handout}[1995/09/14 v1.0 beta 6.044 handout style]

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}

\ProcessOptions\relax

\LoadClass{article}

\setlength\parindent{0.0in} 
\setlength\listparindent{0.0in} 
\setlength{\itemsep}{0in}
% \setlength\itemindent{0.1in}
\setlength{\parskip}{\medskipamount}

% Cross-references for handout numbers.

\newcommand{\hlabel}[2]{\write\@auxout{\string\newlabel{#1}{{#2}{0}}}}

\input{handouts-6044-fall-95}   % defines handout labels

% Make \section use \large instead of \Large typeface.

\ifcase \@ptsize\relax
        \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
            -.2ex}{2.3ex plus .2ex}{\large\bf}}
\or
        \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
            -.2ex}{2.3ex plus .2ex}{\large\bf}}
\or
        \def\section{\@startsection {section}{1}{\z@}{-3.5ex plus -1ex minus 
            -.2ex}{2.3ex plus .2ex}{\large\bf}}
\fi

% use \nullsec if the first thing after \handout isn't \section

\newcommand{\nullsec}{\vspace*{3.25ex plus 1ex minus .2ex}}

% header hackery

\newlength{\toppush}
\setlength{\toppush}{2\headheight}
\addtolength{\toppush}{\headsep}

% \doheading{handout number}{title}{date}

\def\doheading#1#2#3{\vfill\eject\vspace*{-\toppush}%
  \vbox{\hbox to\textwidth{\subjnum: \subjname \hfil Handout #1\strut}%
    \hbox to\textwidth{Massachusetts Institute of Technology\hfil#3\strut}%
    \hrule}}

\newcommand{\htitle}[1]{\vspace*{3.25ex plus 1ex minus .2ex}%
  \begin{center}{\Large\bf #1}\end{center}}

% page style that displays just footers

\def\ps@justfooters{\let\@mkboth\@gobbletwo\def\@oddhead{}%
        \def\evenhead{}}

% \handout{handout label}{title}{date}

%\def\donameheading#1#2#3{%\vfill\eject\vspace*{-\toppush}%
%  \vbox{\hbox to\textwidth{\subjnum: Handout#1: #2\strut}%
%        \hrule \vspace{.1in}
%    \hbox to\textwidth{\large\bf INITIALS\strut}%
%    \hrule}}

\def\donameheading#1#2#3{
  \vbox{\hbox to\textwidth{\subjnum\ Handout \protect\ref{#1}:#2\strut}%
    \hline
    \hbox to\textwidth{\large\bf INITIALS \strut}
    \hline}} 

\def\handout#1{\@dblarg{\@handout{#1}}}

\def\@handout#1[#2]#3#4{%
    \thispagestyle{justfooters}%
    \markboth{\subjnum\ Handout \protect\ref{#1}: #2}%
             {\subjnum\ Handout \protect\ref{#1}: #2}%
    \doheading{\protect\ref{#1}}{#3}{#4}%
    \htitle{#3}%
}

%%  \newcommand{\handout}[3]{\thispagestyle{justfooters}%
%%    \markboth{\subjnum\ Handout \protect\ref{#1}: #2}%
%%      {\subjnum\ Handout \protect\ref{#1}: #2}%
%%    \doheading{\protect\ref{#1}}{#2}{#3}%
%%    \htitle{#2}}

% \quiz{handout label}{title}{date}

\newcommand{\quiz}[3]{\thispagestyle{justfooters}%
  \markboth{\subjnum\ Handout \protect\ref{#1}: #2}%
           {\vbox{\hbox{\subjnum\ Handout %
        \protect\ref{#1}: #2\strut}%
        \hrule\hbox{\bf NAME\vrule height12pt depth3.5pt width\z@}\hrule}}
  \doheading{\protect\ref{#1}}{#2}{#3}%
  \htitle{#2}%
  \advance\headheight by 16.3pt}


% \handoutwithouttitle{handout label}{date}

\newcommand{\handoutwithouttitle}[2]{\thispagestyle{justfooters}%
  \markboth{\subjnum\ Handout \protect\ref{#1}}%
    {\subjnum\ Handout \protect\ref{#1}}%
  \doheading{\protect\ref{#1}}{#2}{}}

\pagestyle{myheadings}
