%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Simon's Lab Notes Class for 1998
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Simon Moore, University of Cambridge, Computer Laboratory
% Please use freely (it's just a hack!)
% Source from: http://www.cl.cam.ac.uk/~swm11/letters/index.html
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% bsed on the article class
\LoadClass[11pt,a4paper]{article}

\typeout{Simon Moore's Computer Lab Notes Class for 1998}

\usepackage{sabon}		  % Univ. font is Sabon!
\renewcommand{\ttdefault}{cmtt}   % but don't use courier for typewriter
\usepackage{color}
\usepackage{graphics}
\usepackage{fancybox}

% page layout
\pagestyle{empty}
\raggedbottom
\setlength{\oddsidemargin}{-1in}
\setlength{\evensidemargin}{-1in}
    % use -31mm for official skip, -25mm for window envelopes
\setlength{\topmargin}{-25mm}
\setlength{\textwidth}{210mm}
\setlength{\textheight}{280mm}
\parskip 10pt
\parindent 0.0pt


\newcommand{\fromnamedetails}{Use \\from to speficfy your name,
position, email, phone, fax}
\newcommand{\fromquoldetails}{your qualifications?}
\newcommand{\fromjobdetails}{your position?}
\newcommand{\fromemaildetails}{email?}
\newcommand{\fromphonedetails}{phone?}
\newcommand{\fromfaxdetails}{fax?}
\newcommand{\fromwhom}[6]{
	\renewcommand{\fromnamedetails}{#1}
	\renewcommand{\fromquoldetails}{#2}
	\renewcommand{\fromjobdetails}{#3}
	\renewcommand{\fromemaildetails}{#4}
	\renewcommand{\fromphonedetails}{#5}
	\renewcommand{\fromfaxdetails}{#6}
        }

\newcommand{\cuarms}{\includegraphics{CUni3.eps}}
\newcommand{\bwarms}{\renewcommand{\cuarms}{\includegraphics{BWUni3.eps}}}



\newcommand{\dohead}{%
\setlength{\unitlength}{1mm}
\begin{picture}(160,55)(0,0)
\put(0,35){\makebox(160,20)[tl]{\parbox{\textwidth}{\bf\fromnamedetails\fromquoldetails\\\it\fromjobdetails}}}
\put(0,10){\makebox(160,24.5)[tr]{\cuarms}}
\put(0,10){\makebox(160,24.5)[br]{\parbox{136pt}{\fontsize{14pt}{14pt}\bf Computer\hfill Laboratory}}}
\end{picture}
}


\newcommand{\dofoot}{\fontsize{9pt}{10pt}\rm\hfill\begin{tabular}{@{}l@{ }l@{}}
 & \\
\multicolumn{2}{@{}l@{}}{Computer Laboratory}\\
\multicolumn{2}{@{}l@{}}{New Museums Site}\\
\multicolumn{2}{@{}l@{}}{Pembroke Street}\\
\multicolumn{2}{@{}l@{}}{Cambridge~~~CB2 3QG}\\
\multicolumn{2}{@{}l@{}}{U.K.}\\
 & \\
Tel: & \fromphonedetails\\
Fax: & \fromfaxdetails\\
E-mail: & \fromemaildetails\\
\end{tabular}%\let\@oddfoot\@empty
}


\newcommand{\twonotes}{%
\hspace*{1in}\begin{minipage}{16cm}
\dohead

\vspace*{110pt}
\dofoot
\vspace*{12pt}
\end{minipage}

\rule{6mm}{0.02mm}\hfill\rule{6mm}{0.02mm}

\vspace*{22pt}\hspace*{1in}\begin{minipage}{16cm}
\dohead

\vspace*{110pt}
\dofoot
\end{minipage}
\cleardoublepage}



\newcommand{\onenote}{%
\hspace*{1in}\begin{minipage}{16cm}
\dohead
\end{minipage}

\vfill

\hspace*{1in}\begin{minipage}{16cm}
\dofoot
\vspace*{6pt}
\end{minipage}
\cleardoublepage}



\newcommand{\afivenote}{
\begin{Sbox}
\begin{minipage}{16cm}
\dohead

\vspace*{454pt}
\dofoot
\vspace*{36pt}
\end{minipage}
\end{Sbox}
\rotatebox{-90}{\scalebox{0.75}{\TheSbox}}
}


\newcommand{\twonoteportrait}{%
\afivenote

\vspace*{26pt}

\rule{6mm}{0.02mm}\hfill\rule{6mm}{0.02mm}

\vspace*{14pt}

\afivenote
\cleardoublepage}


\newenvironment{onepagenote}
	{\hspace*{1in}\begin{minipage}{16cm}
	\dohead}{\end{minipage}\vfill
	\hspace*{1in}\begin{minipage}{16cm}\dofoot\vspace*{6pt}\end{minipage}
	\cleardoublepage}
