%% unswcover.sty
%% Olivier Mehani
%% A titlepage (not using the titlepage environment) can be inserted with
%%  \makeunswphdtitlepage
%% The name of the school can be specified with 
%%  \unswschool{SCHOOL}
%% If the thesis is done in cotutelle, the other Uni can be introduced with
%%  \unswcotutelle{OTHERUNI}
%% A more complete front matter including all statements (originality, copyright
%% and authenticity) for final publication can be inserted with
%%  \makeunswfrontmatter
%% With this command, aPDF version of the Thesis/Dissertation Sheet can be
%% inserted at the back of the titlepage. That file can be specified with
%%  \unswdissertationsheet{FILENAME.pdf}
%% Based on the code in Guillaume Jourjon's PhD thesis
\ProvidesPackage{unswcover}[2013/03/20 v1.0 Initial CTAN release]
%% Release history:
%% - no version, 2011, Olivier Mehani: Used in my PhD thesis template
%% - v1.0pre, 2013, Olivier Mehani: Split out from the thesis into a proper
%%   package
%% - v1.0, 2013, Olivier Mehani: Added version and history for CTAN
%%
%% Source available in Git at [0].
%% [0] https://scm.narf.ssji.net/git/unswcover/
\RequirePackage[australian]{babel}
\RequirePackage{graphicx}
\RequirePackage{pdfpages}

\def\unswschool{\def\UNSW@school}
\unswschool{}

\def\unswdegree{\def\UNSW@degree}
\unswdegree{}
\def\UNSW@degree{Doctor of Philosophy}

\newif\ifUNSW@cotutelle
\def\unswcotutelle{\UNSW@cotutelletrue%
  \def\UNSW@cotutelle}
\UNSW@cotutellefalse

\newif\ifUNSW@dissertationsheet
\def\unswdissertationsheet{\UNSW@dissertationsheettrue%
  \def\UNSW@dissertationsheet}
\UNSW@dissertationsheetfalse

\def\makeunswphdtitlepage{%
  \clearpage{\pagestyle{empty}\cleardoublepage}%
  \@ifundefined{pdfbookmark}{}{% Add PDF bookmark if hypertext has been loaded
    \pdfbookmark{UNSW Cover Page}{unswcover}
  }
  \selectlanguage{australian}
  \setcounter{page}{1}
  \thispagestyle{empty}
  \begin{center}
    \vspace{4\bigskipamount}
    %% XXX: This is a hack to have proper line spacing in the title
    %% For some reason, when no character in a line of the title goes below the 
    %% baseline, the descent is ignored...
    {\Huge {\textbf{\vphantom{g}\@title}}}\\
    %{\Huge {\textbf{\@title}}}\\
    \vspace{5\bigskipamount}
    {\Large {\textbf{\@author}}}\\
    \vspace{3\bigskipamount}
    A dissertation submitted in fulfilment \\
    of the requirements for the degree of  \\
    {\textbf{\UNSW@degree}}\\
    \vspace{2\bigskipamount}
    \begin{center}
      \includegraphics[width=3cm]{logo_unsw_short}
    \end{center}
    \vspace{2\bigskipamount}
    {\textbf{\UNSW@school}
    \textbf{The University of New South Wales}}\\
    \ifUNSW@cotutelle
    \bigskip{}
    in a cotutelle agreement with\\
    \bigskip{}
    {\textbf{\UNSW@cotutelle}}\\
    \else
    \vspace{3\bigskipamount}
    \fi
    \bigskip{}
    \@date
  \end{center}}

\def\makeunswfrontmatter{%
\makeunswphdtitlepage

\ifUNSW@dissertationsheet
\includepdf{\UNSW@dissertationsheet}
\fi

\chapter*{}

\section*{Originality Statement}

I hereby declare that this submission is my own work and to the best of my
knowledge it contains no materials previously published or written by another
person, or substantial proportions of material which have been accepted for the
award of any other degree or diploma at UNSW or any other educational
institution, except where due acknowledgement is made in the thesis. Any
contribution made to the research by others, with whom I have worked at UNSW or
elsewhere, is explicitly acknowledged in the thesis. I also declare that the
intellectual content of this thesis is the product of my own work, except to
the extent that assistance from others in the project's design and conception
or in style, presentation and linguistic expression is acknowledged.

\vspace{1em}

\begin{tabular}[h!]{ll}
  Signed & \@author \\
  Date & \@date
\end{tabular}

\@ifundefined{extrainfobox}{}{\vfill\usebox{\extrainfobox}}

\vspace{3em}

\chapter*{}

\section*{Copyright Statement}

I hereby grant the University of New South Wales or its agents the right to
archive and to make available my thesis or dissertation in whole or part in the
University libraries in all forms of media, now or here after known, subject to
the provisions of the Copyright Act 1968. I retain all proprietary rights, such
as patent rights. I also retain the right to use in future works (such as
articles or books) all or part of this thesis or dissertation.  I also
authorise University Microfilms to use the 350 word abstract of my thesis in
Dissertation Abstract International (this is applicable to doctoral theses
only).  I have either used no substantial portions of copyright material in my
thesis or I have obtained permission to use copyright material; where
permission has not been granted I have applied/will apply for a partial
restriction of the digital copy of my thesis or dissertation.

\vspace{1em}

\begin{tabular}[h!]{ll}
  Signed & \@author \\
  Date & \@date
\end{tabular}

\vspace{3em}

\section*{Authenticity Statement}

I certify that the Library deposit digital copy is a direct equivalent of the
final officially approved version of my thesis. No emendation of content has
occurred and if there are any minor variations in formatting, they are the
result of the conversion to digital format.

\vspace{1em}

\begin{tabular}[h!]{ll}
  Signed & \@author \\
  Date & \@date
\end{tabular}

\vspace{3em}

}
