% mscexam.sty
% Style for MSc exam paper. This does headers + footers, but not paper
% name, date, etc.
% From the exam.sty that I inherited, and updated to meet the 1999
% requirements.

\setlength{\textwidth}{6.2in}
\setlength{\textheight}{9.0in}
\setlength{\topmargin}{0in}
\setlength{\headsep}{0in}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}

\newcounter{questnum}
\newcommand{\question}{%
  \addtocounter{questnum}{1}%
  \bigbreak%
  \textbf{\arabic{questnum}.}\ }    

% First page: exam code(s) top left; also an instruction not to
% turn over ... yet
%
% pagestyle of first page
\newcommand{\ps@firstexam}{%
  \renewcommand{\@oddhead}{\textsf{\small\examcode}\hfil}%
\renewcommand{\@oddfoot}{%
  \hfil\thepage\hfil%
  \raisebox{1cm}[0pt][0pt]{%
    \makebox[0pt][r]{%
      \textbf{Do not turn this page until you are told that you may do so}}}}
  \renewcommand{\@evenhead}{}% evens irrelevant as first page is odd
  \renewcommand{\@evenfoot}{}}

% All intemediate pages: turn over instruction on odd pages
%
% standard exam pagestyle
\newcommand{\ps@exam}{%
  \renewcommand{\@oddhead}{}%
  \renewcommand{\@evenhead}{}%
  \renewcommand{\@oddfoot}{%
    \textsf{\small\papernumber}\hfil\thepage\hfil\textbf{Turn over}}%
  \renewcommand{\@evenfoot}{%
    \textsf{\small\papernumber}\hfil\thepage\hfil}}

% Last page: identified as such
%
% pagestyle of last page
\newcommand{\ps@lastexam}{%
  \renewcommand{\@oddhead}{}%
  \renewcommand{\@evenhead}{}%
  \renewcommand{\@oddfoot}{%
    \textsf{\small\papernumber}\hfil\thepage\hfil\textbf{End of last page}}%
  \renewcommand{\@evenfoot}{\@oddfoot}}
