% File exam.cls \ProvidesClass{exam}[1999/04/02 by F.J.Wright@Maths.QMW.ac.uk] \NeedsTeXFormat{LaTeX2e}[1998/06/01] \RequirePackage{ifthen} \newboolean{NZQRC} \DeclareOption{BSc}{\def\BSc@MSc{B.Sc.}} \DeclareOption{MSc}{\def\BSc@MSc{M.Sc.}} \DeclareOption{NZQRC}{\setboolean{NZQRC}{true}% \newcommand{\mbb}[1]{\ensuremath{\mathbb{#1}}}% \newcommand{\N}{\mbb{N}}% \newcommand{\Z}{\mbb{Z}}% \newcommand{\Q}{\mbb{Q}}% \newcommand{\R}{\mbb{R}}% \newcommand{\C}{\mbb{C}}} \ExecuteOptions{BSc} \ProcessOptions* \LoadClass[12pt]{article}[1998/05/05] \ifthenelse{\boolean{NZQRC}}{% \RequirePackage{amsfonts}[1996/11/03]}{} \setlength{\textwidth}{6.5in} \setlength{\textheight}{9in} \setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{\oddsidemargin} \setlength{\topmargin}{-0.2in} % Exam header: \newcommand{\examtitle}[1]{\newcommand{\exam@title}{#1}} \newcommand{\examtime}[1]{\newcommand{\exam@time}{#1}} \AtBeginDocument{% \vspace*{-0.4in}\noindent {\Large\bfseries Queen Mary and Westfield College} \\ {\large\sffamily UNIVERSITY OF LONDON} \\[0.2in] {\Large\sffamily \BSc@MSc\ EXAMINATION} \\[0.2in] {\large\bfseries \exam@title} \\[0.2in] \exam@time \vspace{0.2in} } % Exam footer: \def\@oddfoot{\makebox[0pt][l]{\textrm{\ifnum\thepage=1 \copyright\ QMW, University of London \number\year\fi}}% \hfil\textrm{\thepage}\hfil% \makebox[0pt][r]\leftmark} % \leftmark outputs the LAST "left" mark set by \markboth \let\@evenfoot\@oddfoot \AtEndDocument{% \markboth{\textit{[End of examination paper.]}}{}} % Section command and rubric environment: \newcommand{\long@questions}{true} \renewcommand{\section}[2][]% {\noindent{\large\bfseries SECTION #2} \ifthenelse{\equal{#1}{short}}% {\renewcommand{\long@questions}{false}}% {\renewcommand{\long@questions}{true}}} % \section ought to suppress an immediately following page break, but % since the following text will be in an environment this is tricky! \newenvironment{rubric}[1][]% {\newboolean{long@}% \ifthenelse{\equal{#1}{}}% {\setboolean{long@}{\long@questions}}% {\ifthenelse{\equal{#1}{short}}% {\setboolean{long@}{false}}{\setboolean{long@}{true}}}% \begin{quote}\em}% {\end{quote} \ifthenelse{\boolean{long@}}{\vspace{\baselineskip}}{}} % Question environments: \newcounter{qno} \newenvironment{questions}[1][]% {\begin{list}{\textbf{\arabic{qno}.}}% {\usecounter{qno}% \ifthenelse{\(\equal{#1}{} \and \equal{\long@questions}{false}\) \or \equal{#1}{short}}{}% {\setlength{\itemsep}{3\baselineskip}}}}% {\end{list}% \markboth{\textit{[Next section overleaf.]}}{} \vspace{3\baselineskip}} \newboolean{LastQuestion} \newenvironment{question}[1][]% {\item% \markboth{\textit{[This question continues overleaf \ldots]}}{}% \ifthenelse{\equal{#1}{last}}% {\setboolean{LastQuestion}{true}}% {\setboolean{LastQuestion}{false}}}% {\ifthenelse{\boolean{LastQuestion}}% {\markboth{\textit{[End of examination paper.]}}{}}% last question {\markboth{\textit{[Next question overleaf.]}}{}}} % Sub-question environments: \newcounter{subqno} \newenvironment{subquestions}% {\begin{list}{(\alph{subqno})}{\usecounter{subqno}}}% {\end{list}} \let\subquestion\item \newcounter{subsubqno} \newenvironment{subsubquestions}% {\begin{list}{(\roman{subsubqno})}{\usecounter{subsubqno}}}% {\end{list}} \let\subsubquestion\item % Miscellaneous useful commands: \renewcommand{\th}{\ensuremath{^\mathit{th}}} % By default, \th represents thorn in the Cork encoding (T1) etc. % End of file exam.cls