%\newcommand{\ket}[1]{\mbox{$\left| #1 \right>$}}
\documentclass[11pt,titlepage,twoside,a4paper]{exam}
\usepackage{headers}
\usepackage{psfig}
\usepackage{graphicx}
%\usepackage{amsmath,amssymb}
\newif\ifdraft
\draftfalse%true

\newcommand{\startpaper}[1]{
\begin{document}
\raggedbottom
\def\seriallet{#1}\def\serialno{#1}\ifdraft\def\draft{DRAFT \today}\else\def\draft{}\fi
\def\turnover{[{\bf Turn over}]}\def\stopsign{}
\pagestyle{headings}
}

%Macros for units
\def\A{\,{\rm A}}
\def\C{^\circ{\rm C}}
\def\dB{\,{\rm dB}}

\def\eV{\,{\rm eV}}
\def\keV{\,{\rm keV}}
\def\MeV{\,{\rm MeV}}
\def\GeV{\,{\rm GeV}}
\def\TeV{\,{\rm TeV}}

\def\J{\,{\rm J}}
\def\kJ{\,{\rm kJ}}
\def\MJ{\,{\rm MJ}}

\def\Hz{\,{\rm Hz}}
\def\kHz{\,{\rm kHz}}
\def\MHz{\,{\rm MHz}}
\def\GHz{\,{\rm GHz}}

\def\Pa{\,{\rm Pa}}
\def\hPa{\,{\rm hPa}}
\def\kPa{\,{\rm kPa}}

\def\ha{\,{\rm ha}}
\def\K{\,{\rm K}}

\def\pS{\,{\rm pS}}
\def\T{\,{\rm T}}

\def\g{\,{\rm g}}
\def\kg{\,{\rm kg}}

\def\mb{\,{\rm mb}}
\def\fm{\,{\rm fm}}
\def\micron{\,\mu{\rm m}}
\def\nm{\,{\rm nm}}
\def\mm{\,{\rm mm}}
\def\cm{\,{\rm cm}}
\def\m{\,{\rm m}}
\def\km{\,{\rm km}}
\def\AA{\,\hbox{\accent'27A}}				%  Angstrom units
\let\and=\AA								% alias for Angstrom units

\def\pc{\,{\rm pc}}
\def\kpc{\,{\rm kpc}}
\def\Mpc{\,{\rm Mpc}}

\def\s{\,{\rm s}}
\def\ms{\,{\rm ms}}
\def\ns{\,{\rm ns}}
\def\ps{\,{\rm ps}}
\def\yr{\,{\rm yr}}
\def\Myr{\,{\rm Myr}}
\def\Gyr{\,{\rm Gyr}}

\def\rad{\,{\rm rad}}
\def\sr{\,{\rm sr}}

\def\mps{\,{\rm m\,s^{-1}}}
\def\kmps{\,{\rm km\,s^{-1}}}

\def\V{\,{\rm V}}
\def\mV{\,{\rm mV}}
\def\mA{\,{\rm mA}}
\def\mW{\,{\rm mW}}
\def\W{\,{\rm W}}
\def\kW{\,{\rm kW}}
\def\GW{\,{\rm GW}}
\def\kWh{\,{\rm kWh}}

\def\MEarth{\,M_\oplus}% Mass of Earth
\def\REarth{\,R_\oplus}% Radius of Earth
\def\MSun{\,M_\odot}% Mass of Sun
\def\RSun{\,R_\odot}% Radius of Sun

\def\Im{\,{\rm Im}}
\def\Re{\,{\rm Re}}

\def\Fe{\,{\rm Fe}}
\def\Te{\,{\rm Te}}
\def\Tm{\,{\rm Tm}}
\def\Wm{\,{\rm Wm}}

\def\mM{\,{\rm mM}}
\def\microM{\,{\rm \mu M}}
\def\N{\,{\rm N}}
\def\pN{\,{\rm pN}}

\def\geqsim{\mathbin{\;\raise2pt\hbox{$>$}\kern-8pt\lower3.5pt\hbox{$\sim$}\;}}
\def\leqsim{\mathbin{\;\raise2pt\hbox{$<$}\kern-8pt\lower3.5pt\hbox{$\sim$}\;}}

\def\ph{\strut\phantom y}		  %to be used as a superscript to force
												%a subscript further down



%Macros for some similar things
\def\kB{k_{\rm B}}% Boltmann's constant

\def\ket#1{|#1\rangle}
\def\bra#1{\langle#1|}
%Macro to give small fractions
\def\fracj#1#2{{\textstyle{#1\over#2}}}

%Set some lengths
\setlength{\textheight}{225mm}
\setlength{\oddsidemargin}{7mm}
\setlength{\evensidemargin}{7mm}
\setlength{\topmargin}{-3mm}
\setlength{\textwidth}{146mm}
\parindent=1truecm
%\arraycolsep0.35mm                     	% makes multiple equations look nice
											% but makes 'arrays' look awful
											
\newcount\questionno\questionno=0
\newcount\shortsectionno\shortsectionno=0
\newif\ifbreakok\breakoktrue


\def\dis{\displaystyle}			%for use in textstyle of maths
\def\txs{\textstyle}			%for use in displaystyle of maths


\font\mathi=cmmi10
\font\mathbi=cmmib10

\def\point{{\cdot}}
%\mathcode `.="0201			%centralises the dot when in math mode
%
%\def\fs{\hbox{\mathi\char'072}}		%defines a `full stop' for use in 
									%Maths Display mode.

%\def\dotprod{\mathrel{\hbox{\mathbi\char'072}}}
\def\dotprod{{\hbox{\mathbi\char'072}}}

\def\dbar{{\mathchar'26\mskip-10mu\d}}

\def\xx{\phantom1}


\newenvironment{question}{\ifbreakok\pagebreak[3]\fi\everypar={\samepage}
\global\advance\questionno by 1\textindent{\bf\the\questionno.}}
{\vskip.2cm plus 1cm\vfill\breakoktrue\everypar={\pagebreak[3]}}

\def\textindent#1{\noindent\makebox[\parindent][c]{#1}\ignorespaces}

\def\section#1{
\vskip20pt\ifbreakok\pagebreak[3]\fi\centerline{\bf Section #1}\breakokfalse
\samepage\vbox to 10pt{}\samepage
}


\def\Section#1{
\vskip20pt\ifbreakok\pagebreak[3]\fi\centerline{\Large\bf Section #1}\breakokfalse
\samepage\vbox to 10pt{}\samepage
}

\def\ShortSection#1#2{%
    \questionno=0%
	\newpage%
	\centerline{\bf Section S{\bf #1 ~~ #2}}%
	\label{S#1}
	\samepage\vbox to 10pt{}\samepage
}

\newcommand{\oxfinishpaper}[0]{
\def\turnover{\bf [LAST PAGE]}\def\stopsign{\bf [LAST PAGE]}
\end{document}
}


\newcommand{\oxmarks}[1]{\vadjust{\vbox to 0pt%
	{\vss\hbox{\hskip\hsize\qquad\makebox [.5cm][r]{[#1]}}
	\hrule height 0pt depth 0pt}}\ifmmode\else\vskip3pt\fi}

%Define 26 calligraphic letters, \cA to \cZ (add any others you want
%to \callist):
{\newif\ifnotend
\notendtrue
\def\callist{ABCDEFGHIJKLMNOPQRSTUVWXYZ.}
\def\top#1#2.{#1}
\def\tail#1#2.{#2.}
\loop\expandafter\xdef\csname c\expandafter\top\callist\endcsname%
{{\noexpand\cal\expandafter\top\callist}}
\edef\callist{\expandafter\tail\callist}
\if\callist.\notendfalse\fi\ifnotend\repeat}

%Define 52 bold letters, \vA to \vz (add any others you want
%to \callist):
{\newif\ifnotend
\notendtrue
\def\veclist{ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz.}
\def\top#1#2.{#1}
\def\tail#1#2.{#2.}
\loop\expandafter\xdef\csname v\expandafter\top\veclist\endcsname%
{{\noexpand\bf\expandafter\top\veclist}}
\edef\veclist{\expandafter\tail\veclist}
\if\veclist.\notendfalse\fi\ifnotend\repeat}

%\def\p{\partial}
\def\pa{\partial}
\def\grad{\mathop{\rm grad}\nolimits}
\def\curl{\mathop{\rm curl}\nolimits}
\def\Div{\mathop{\rm div}\nolimits}
\def\const{{\rm const}}
\def\He{{\rm He}}

\def\d{{\rm d}} \def\D{{\rm D}}
\def\e{{\rm e}}
\def\i{\relax\ifmmode{\rm i}\else\char16\fi}
\def\o{{\rm o}}
\def\q{{\rm q}}
\def\r{{\rm r}}

%block symbol
\font\lasy=lasy10 \def\block{\hbox{{\lasy\char50}}}	
%Symbols for neutrons, protons, Kaons
\def\neu{{\rm n}} \def\pr{{\rm p}} \def\Ka{{\rm K}}
%Define symbols for quarks
\def\uq{{\rm u}} \def\dq{{\rm d}} \def\sq{{\rm s}}
\def\cq{{\rm c}} \def\bq{{\rm b}} \def\tq{{\rm t}}

\def\in{{\rm in}}
\def\out{{\rm out}}
\def\rel{{\rm rel}}
\def\rms{{\rm rms}}
\def\sat{{\rm sat}}
\def\dss{{\rm dss}}
\def\mol{{\rm mol}}
\def\sign{{\rm sign}}



\def\vnabla{{\mathchoice%		bold face nabla
{{\bf\nabla}}
{{\bf\nabla}}
{{\bf\nabla}}
{{\bf\nabla}}
}}%

%fonts for bold maths
\font\gkvecten=cmmib10
\font\gkvecseven=cmmib7
\let\boldgrk=\gkvecten
\let\boldgrksc=\gkvecseven

%Bold italics
\def\bi#1{{\mathchoice%
	{\hbox{{\boldgrk#1}}}
	{\hbox{{\boldgrk#1}}}
	{\hbox{{\boldgrksc#1}}}
	{\hbox{{\boldgrksc#1}}}}}


\def\gkthing#1{{\mathchoice%
	{\hbox{{\boldgrk\char#1}}}
	{\hbox{{\boldgrk\char#1}}}
	{\hbox{{\boldgrksc\char#1}}}
	{\hbox{{\boldgrksc\char#1}}}}}

% Bold face Greek letters
\def\valpha{\gkthing{11}}
\def\vbeta{\gkthing{12}}
\def\vgamma{\gkthing{13}}
\def\vdelta{\gkthing{14}}
\def\vepsilon{\gkthing{15}}
\def\vzeta{\gkthing{16}}
\def\veta{\gkthing{17}}
\def\vtheta{\gkthing{18}}
\def\viotaeta{\gkthing{19}}
\def\vkappa{\gkthing{20}}
\def\vlambda{\gkthing{21}}
\def\vmu{\gkthing{22}}
\def\vnu{\gkthing{23}}
\def\vxi{\gkthing{24}}
\def\vpi{\gkthing{25}}
\def\vrho{\gkthing{26}}
\def\vsigma{\gkthing{27}}
\def\vtau{\gkthing{28}}
\def\vupsilon{\gkthing{29}}
\def\vphi{\gkthing{30}}
\def\vchi{\gkthing{31}}
\def\vpsi{\gkthing{32}}
\def\vomega{\gkthing{33}}
\def\vOmega{\gkthing{10}}
\def\vLambda{{\bf\Lambda}}


