% VUW HONOURS REPORTS MODIFICATIONS TO ARTICLE/REPORT DOCUMENT STYLES
%        -- modified from vuwstyle
%        -- released 3 October 1991
% Modifed by Ewan Tempero for the new TR cover. October 1993.
%
% Now allows \supervisors as well as \supervisor. NL Dec 2002
% 
% Sets up cover page and page size for VUW CS reports
%
%% Now in the ECS CVS as of 2010-04-23, following some reworking
%%
%% $RCSfile: vuwproject.sty,v $
%% $Revision: 1.9 $
%% $Date: 2022/04/12 04:03:59 $
%% $Author: mark $
%%
% INSTRUCTIONS
%
% Must use 11pt
%
% works with report style
%
% use \title{} to specify title, \author{} to specify author,
%       \supervisor(s){} to specify supervisor(s), \date{} to specify date,
%       and ``abstract'' environment for abstract. 
%
% Current options are:
% [ecs|msor]              Which school you are in.
%
% [bschonscomp|mcompsci]  Which degree you are doing
%                          You can also specify any other degree by name
%                          (see below)
% [font|image]            Use a font or an image for the VUW logo
%                          The font option will only work on ECS systems
%
% If you don't use the package options, bschonscomp or mcompsci,
%  to specify the degree you can use
%
%   \otherdegree{OTHER DEGREE OR DIPLOMA NAME}


\DeclareOption{ecs}{%
\gdef\Ecs@school{School of Engineering and Computer Science}%
\gdef\Ecs@schoolmaori{Te Kura M\=atai P\=ukaha, P\=urorohiko}%
\gdef\Ecs@schoolacronymlower{ecs}}

\DeclareOption{msor}{%
\gdef\Ecs@school{School of Mathematics, Statistics \\ and Operations Research}%
\gdef\Ecs@schoolmaori{Te Kura M\=atai Tatauranga, Rangahau P\=unaha}%
\gdef\Ecs@schoolacronymlower{msor}}

\DeclareOption{bschonscomp}{%
\gdef\Ecs@degree{Bachelor of Science with Honours in Computer Science}}
\DeclareOption{mcompsci}{%
\gdef\Ecs@degree{Master of Computer Science}}

\DeclareOption{sms}{%
\gdef\Ecs@school{School of Mathematics and Statistics}%
\gdef\Ecs@schoolmaori{Te Kura M\=atai Tatauranga}%
\gdef\Ecs@schoolacronymlower{sms}
\gdef\Ecs@fromnetaddr{sms-office@vuw.ac.nz}
}

\DeclareOption{image}{\Ecs@imagetrue}
\DeclareOption{font}{\Ecs@imagefalse}
\newif\ifEcs@image

\ProcessOptions

\usepackage{mathpazo} % sets palatino as the default font

\newcommand{\makeblankpage}{\newpage
                            \thispagestyle{empty}
                            \addtocounter{page}{-1}}
                            
\newcommand{\frontmatter}{\pagenumbering{roman}}

\newcommand{\mainmatter}{\cleardoublepage \pagenumbering{arabic}}

\newcommand{\backmatter}{\appendix \cleardoublepage}

\usepackage{graphicx}  % for including images 

\typeout{VUW Honours reports modifications -- Mar 1995}
\typeout{Modified to handle different degrees 2003}
\typeout{Modified to handle duplex printing properly 2006}
\ifnum\@ptsize=1\else
\typeout{}
\errmessage{Honours Reports must be in 11pt, (add 11pt to documentstyle options)}
\fi

\DeclareFixedFont{\halj}{\f@encoding}{phv}{bx}{n}{18}
\DeclareFixedFont{\halk}{\f@encoding}{phv}{m}{n}{18}
\DeclareFixedFont{\smallhal}{\f@encoding}{phv}{m}{n}{9}

\if@twoside
   \oddsidemargin 0mm \evensidemargin -3.6mm \marginparwidth 20mm
\else
   \oddsidemargin 2mm \evensidemargin 4.4mm \marginparwidth 20mm
\fi
\marginparsep 2.5mm

\topmargin -8.2mm \headheight 12pt \headsep 25pt \footskip 30pt

\textheight 240mm \textwidth 155mm \columnsep 10pt \columnseprule 0pt

\@ifundefined{Ecs@school}{\gdef\Ecs@school{School: NOT STATED}}{}
\@ifundefined{Ecs@schoolmaori}{\gdef\Ecs@schoolmaori{}}{}
\@ifundefined{Ecs@schoolacronymlower}{\gdef\Ecs@schoolacronymlower{whichschool}}{}

\@ifundefined{Ecs@fromnetaddr}{%
\gdef\Ecs@fromnetaddr{office@\Ecs@schoolacronymlower.vuw.ac.nz}
}{}
\def\netaddr#1{\gdef\Ecs@fromnetaddr{#1}}

\def\supervisor#1{\gdef\@supervisor{Supervisor: #1}}
\def\supervisors#1{\gdef\@supervisor{Supervisors: #1}}
\gdef\@supervisor{Supervisor: NOT STATED}

\@ifundefined{Ecs@degree}{\gdef\Ecs@degree{DEGREE NOT STATED}}{}
\def\otherdegree#1{\gdef\Ecs@degree{#1}}

\def\maketitle{\begin{titlepage}
\thispagestyle{empty}
 \let\footnotesize\small
 \let\footnoterule\relax
 \if@twoside\setcounter{page}{-1}\else\setcounter{page}{0}\fi
 \null

\begin{center}
\includegraphics[width=95mm]{VUW_Standard_Landscape_BLACK}\\*[16pt]
\addtolength{\baselineskip}{6pt}
{\halj \Ecs@school \\ \halk \Ecs@schoolmaori }
\end{center}

\vspace*{-2mm}
\noindent
\hspace*{3mm}
{\smallhal
\parbox{40mm}{
PO Box 600\\
Wellington\\
New Zealand}\hfill
\parbox{65mm}{
\flushright
Tel:    +64 4 463 5341\\
Internet: \Ecs@fromnetaddr\\
\mbox{}}
}
\parbox{3mm}{\mbox{}}

 \begin{center}
  \parbox{100mm}{\center\LARGE\bf\@title}\par
  \vskip 1em
  \parbox{100mm}{\center\large\@author}\par
  \vskip 1em
   \parbox{100mm}{\center\large \@supervisor}\par 
  \vskip 1em
  {\large \@date \par}
  \vskip 1em
  \parbox{100mm}{\center Submitted in partial fulfilment of the requirements
     for \\ \Ecs@degree.}\par
\end{center} \par
\@thanks
\vskip 1em
\begin{center}
{\bf Abstract\vspace{-.5em}\vspace{0pt}}
\end{center}
\vskip 1ex
\hskip\leftmargini\box\@abstract
\vfill
\end{titlepage}

\setcounter{footnote}{0}
\if@twoside\newpage\mbox{}\clearpage\setcounter{page}{1}\fi
\let\thanks\relax
\gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\maketitle\relax
}

\newbox\@abstract
\def\abstract{\global\setbox\@abstract\vbox\bgroup
   \advance\linewidth -2\leftmargini
   \hsize\linewidth}

\def\endabstract{\egroup}
