% File exam.cls \ProvidesClass{exam}[2007/01/07 by Francis J. Wright] \typeout{for BSc, MSci and MSc exams at Queen Mary, University of London, UK;} \typeout{see http://centaur.maths.qmul.ac.uk/Exam/} \NeedsTeXFormat{LaTeX2e}[2005/12/01] \RequirePackage{ifthen} \DeclareOption{BSc}{\def\BSc@MSc{B.Sc.}} \DeclareOption{MSc}{\def\BSc@MSc{M.Sc.}} \DeclareOption{MSci}{\def\BSc@MSc{M.Sci.}} \newboolean{logo} \DeclareOption{logo}{\setboolean{logo}{true}} \newboolean{BBB} \DeclareOption{BBB}{\setboolean{BBB}{true}} \DeclareOption{bbb}{\setboolean{BBB}{true}} \DeclareOption{draft}{\PassOptionsToClass{draft}{article}} \ExecuteOptions{BSc} \ProcessOptions* \LoadClass[12pt,a4paper,twoside]{article}[2005/09/16] \ifthenelse{\boolean{BBB}}{% \RequirePackage{amsfonts}% \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}}% \newcommand{\F}{\mbb{F}}% \newcommand{\K}{\mbb{K}}% }{} \setlength{\textwidth}{6.5in} \setlength{\textheight}{9in} \setlength{\oddsidemargin}{0in} \setlength{\evensidemargin}{\oddsidemargin} \setlength{\topmargin}{-0.2in} % Exam heading: \newcommand{\examtitle}[1]{\newcommand{\exam@title}{#1}} \newcommand{\examtime}[1]{\newcommand{\exam@time}{#1}} \AtBeginDocument{% \providecommand{\exam@title}{}% empty default \providecommand{\exam@time}{}% empty default \ifthenelse{\boolean{logo}}{% % The following code to typeout a ~ is based on a comp.text.tex % posting dated 1993-02-09 by Donald Arseneau : %\def\gobble#1{}\def\til{\expandafter\gobble\string\~}% \typeout{QMUL logo support by Steve Schwartz.}% %\typeout{QMUL logo support by Steve Schwartz;}% %\typeout{see http://www.maths.qmul.ac.uk/\til sjs/ExamTemplate/}% %% sjs dec 2002, jan 2003 \RequirePackage{graphicx}% \vspace*{-0.53in}\noindent \typeout{{DVI/PDF} output requires QMUL logo file qmula.{eps/pdf}.}% \includegraphics[width=2.0in]{qmula}\\[0.2in] }{% \vspace*{-0.4in}\noindent {\Large\bfseries Queen Mary} \\ {\large\sffamily UNIVERSITY OF LONDON} \\[0.2in]} {\Large\sffamily \BSc@MSc\ EXAMINATION BY COURSE UNITS} \\[0.2in] {\large\bfseries \exam@title} \\[0.2in] \exam@time \vspace{0.2in} } % Page header - page numbers after first on alternating sides: \def\@oddhead{\ifnum\thepage>1 \hfil\textrm{\thepage} \fi} \def\@evenhead{\textrm{\thepage}\hfil} % Page footer: \def\@oddfoot{\ifnum\thepage=1 {\small\rmfamily \copyright\ Queen Mary, University of London, \number\year} \fi \hfil\leftmark} % \leftmark outputs the LAST "left" mark set by \markboth \let\@evenfoot\@oddfoot \AtEndDocument{% \markboth{\textit{[End of examination paper]}}{}} % Command to end the cover page and start the exam proper: \newcommand{\startexam}{ \vfill \begin{center}\bf YOU ARE NOT PERMITTED TO START READING THIS QUESTION PAPER UNTIL INSTRUCTED TO DO SO BY AN INVIGILATOR \end{center} \vfill \newpage } % Section command and rubric environment: \newcommand{\long@questions}{true} \newcommand{\secname}{}% in case no \section. \renewcommand{\section}[2][]% {\renewcommand{\secname}{#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{\secname\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]}}{}}% {\markboth{\textit{[Next question overleaf]}}{}}}% % Sub-question environments: \newcounter{subqno} \newenvironment{subquestions}% {\begin{list}{(\alph{subqno})}{\usecounter{subqno}}}% {\end{list}}% \newcommand{\subquestion}{\item{}} \newcounter{subsubqno} \newenvironment{subsubquestions}% {\begin{list}{(\roman{subsubqno})}{\usecounter{subsubqno}}}% {\end{list}}% \newcommand{\subsubquestion}{\item{}} % Miscellaneous useful commands: \renewcommand{\th}{\ensuremath{^\mathit{th}}} % By default, \th represents thorn in the Cork encoding (T1) etc. % \renewcommand{\theenumi}{\roman{enumi}} % \renewcommand{\labelenumi}{(\roman{enumi})} % End of file exam.cls