


%% LaTeX2e file `exam08.sty'
%% generated by the `filecontents' environment
%% from source `2MP47JA' on 1997/11/04.
%%
% exam01x.sty
% Style file for Pure Maths examinations 1995, for LaTeX.
% porteous{2nov94}
% that was for LaTeX2.09
% adapted for LaTeX F J Rayner {13 October 1997}
% Further modifications H R Morton{9 October 1998, 
% 18 October 2000, 25 September 2002, 3 December 2004,13 June 2005,
% 5 October 2005, 4 October 2007}
% 


% You should begin by typing
% \documentclass[12pt]{article}
% \usepackage{exam09, ifthen}
% \usepackage{graphicx}
% \begin{document}
% \pagestyle{exam}
% \newcommand{\papercode}{MATH 244}%(or whatever)
%\newcommand{\papertitle}{Linear Algebra and Geometry} (or whatever)

% This will set the margins in a rather simple way, and
% will allow the use of the numbering macro \exno for
% questions.
% It also sets up the pagestyle to number the pages in the right 
% place for the exam stationery, and count the pages.


% You should finish by typing
% \label{lastpage}\end{document}

% H.R.Morton Nov 91/Jan 92/13Jan/2Feb/22Dec/26Jan 93/10Dec
% 1Feb 94
% I.R.Porteous 7Nov 94
% H.R.Morton Oct98/Oct00/Jan01/Sept02/June05/October07
% T. Eckl Feb10







\makeatletter
\newcommand{\ps@exam}{%
\renewcommand{\@oddhead}{\ifthenelse{\boolean{final}}%
{{\ifthenelse{\thepage=\pageref{firstpage}}{}{\hfill \includegraphics[scale=.35]{bwlogo} \hfill}} }{Draft version \hfill\today}}%
\renewcommand{\@oddfoot}%
{Paper Code\quad\textbf{\papercode}%
\qquad\quad Page\ \ %
\thepage\ \ of\ \ \pageref{lastpage}\hfill \ifthenelse{%
\thepage=\pageref{lastpage}}{END}{CONTINUED} }}
\makeatother

% This defines a new pagestyle, so that the paper
% details can be set in the right place for the exam
% stationery.


% 
% To use it you type 
% \newboolean{final}
% \pagestyle{exam}
% after \begin{document}

% For the final run with the university header, type
% \setboolean{final}{true}
% after \begin{document}
% or uncomment the line in the template.

\newcommand{\frontmaterial}{\pagestyle{exam} \addtolength{\topmargin}{-1cm}\addtolength{\headheight}{-1cm}\addtolength{\headsep}{-2cm}\addtolength{\oddsidemargin}{-2cm}\addtolength{\textwidth}{3cm} \framebox{\begin{tabular}{l} PAPER CODE NO. \\ {\bf \papercode} \end{tabular}} \hspace{1cm} \begin{tabular}{ll} EXAMINER: & {\bf \examiner}, TEL.NO. \phone \\ DEPARTMENT: & Mathematical Sciences \end{tabular}  \\ \begin{center} \includegraphics[scale=.35]{bwlogo} \end{center} \vspace{1in} \begin{center}{\bf\large\paperdate}\\[1in]{\bf\large\papertitle}\\[1in]
{\sc Time allowed:} \examlength \\ \rule{16cm}{0.01in} \end{center} INSTRUCTIONS TO CANDIDATES: \rubric \vfill \newpage \addtolength{\topmargin}{1cm}\addtolength{\headheight}{1cm}\addtolength{\headsep}{2cm}\addtolength{\oddsidemargin}{2cm}\addtolength{\textwidth}{-3cm}}
% This command allows the material for the front cover page to be assembled

\setlength\topmargin{-.8in}
\setlength\headsep{.6in}    
\setlength\headheight{1.1in}
\setlength\textheight{8.6in}
\setlength\textwidth{5.7in}



\abovedisplayskip=5pt plus3pt minus2pt
\belowdisplayskip=5pt plus3pt minus2pt

\parskip=\smallskipamount

% These settings give the right size page for the exam
% stationery, and a good spacing in the text.

\newcount\newsection
\newsection=1
 

\newcommand\exno[1]{\vfil
\ifnum\newsection=0
\filbreak
\fi
\vfil\bigskip\noindent\quad{\bf#1.}\quad\newsection=0}

\newdimen\subexamount
\subexamount=2.8\parindent %was 2.4
\newcommand\subexno[1]{\noindent\hskip
\subexamount\llap{\hskip -.4\subexamount  #1 \hfill}}

%Allows subsection numbering within a question.
%If it is to be set on a new line you must start a new
%paragraph. The amount of indent before the text can be
%altered by changing \subexamount, to a new dimension (in

%cm or inches or points.

\newcommand\restart[1]{\par\vskip
-\baselineskip\vskip-\parskip\subexno{#1}}

%Allows a subsection to be numbered by \subexno on the
%same line as the question number, so as to line up with
%other subsection numbers.
%e.g. \exno{2}\restart{(i)}

\newcommand\A{\vfil\filbreak\vfil\bigskip{\centerline
{SECTION A}}\nobreak}
\newcommand\B{\vfil\filbreak\vfil\bigskip{\centerline
{SECTION B}}\nobreak\newsection=1}

\def\marks{\marks}
\renewcommand\marks[1]{\nobreak\hbox{ }\hfill\hbox{[#1
marks]}\hskip 5pt}
%altered to avoid conflict with new tex in texshell, and older tex in unix.

% To enable the mark to be set at the right hand
% bottom corner of the question.

\newcommand\bk{\hfill\break}
%To force a line break, even among a maths formula.

\newcommand\ds{\displaystyle}
\newcommand\ts{\textstyle}
%As a shorthand, e.g. for integral signs in a line