← All templates

University of St Andrews thesis (sta-thesis, community)

A memoir-based doctoral thesis class written in the School of Computer Science at St Andrews, with print, electronic, screen and draft variants; the sample has a title page, abstract, declaration, copyright statement, contents, chapters and a biblatex bibliography.

Create an account to use this
Category
Thesis
Document class
sta-thesis (sta-thesis.cls) — ships with TeX Live
Workflow
Thesis / dissertation — submissions and revision rounds
Author
Jan de Muijnck-Hughes (sta-thesis)
Source
Jan de Muijnck-Hughes (sta-thesis)
Licence
sta-thesis.cls: LaTeX Project Public License. The sample text is Jan de Muijnck-Hughes (sta-thesis)'s, provided for authors preparing a submission.

These are the publisher’s own files. This project starts from Jan de Muijnck-Hughes (sta-thesis)’s package for this publication — their manuscript, their sta-thesis.cls, their bibliography style — so what compiles here is what they would have given you.

Jan de Muijnck-Hughes (sta-thesis) serves this exact file to University of St Andrews. Check Jan de Muijnck-Hughes (sta-thesis)’s author pages for the current instructions.

Where this differs from the publisher’s download.

  • Note: A community template: sta-thesis is written by Jan de Muijnck-Hughes; it is not issued or endorsed by the University of St Andrews. Check it against the current thesis regulations of your university.

What you get

  • colour-blind.sty · 4 KB
  • examples/thesis/biblio.bib · 3 KB
  • examples/thesis/body.tex · 6 KB
  • examples/thesis/sta-colours.sty · 2 KB
  • examples/thesis/sta-thesis.cls · 20 KB
  • examples/thesis/thesis.draft.tex · 222 B
  • examples/thesis/thesis.electronic.tex — the file that is compiled · 227 B
  • examples/thesis/thesis.print.tex · 230 B
  • examples/thesis/thesis.screen.tex · 223 B
  • sta-colours.sty · 2 KB
  • sta-drafting.sty · 3 KB
  • sta-thesis.cls · 20 KB
  • stabs.sty · 10 KB
  • stabsmemoir.sty · 3 KB

These become your files. Editing them afterwards changes your project and nothing else — a project owns its files from the moment it is made.

Source

colour-blind.sty · 4 KB
%% ----------------------------------------------------------- [ Begin Package ]
% Copyright 2016 - Jan de Muijnck-Hughes
%
% This work may be distributed and/or modified under the  conditions
% of the LaTeX Project Public License, either version 1.3c of this
% license or (at your option) any later version.
%
% The latest version of this license can be found at:
%    http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Jan de Muijnck-Hughes
%
% This work consists of the file: colour-blind.sty
% ---------------------------------------------------------------------- [ EOH ]
\ProvidesPackage{colour-blind}
%
% A LaTeX style file providing a 'hopefully' colour blind friendly colour palette.
%
% The palette comes from:
%     http://www.somersault1824.com/wp-content/uploads/2015/02/color-blindness-palette.png
%
% Which is derived itself from:
%     http://mkweb.bcgsc.ca/colorblind/
%
% ------------------------------------------------------------------ [ Imports ]
\RequirePackage{etoolbox}
\RequirePackage{xcolor}

% ------------------------------------------------------- [ Colour Definitions ]

\definecolor{cb-black}      {RGB}{  0,   0,   0}
\definecolor{cb-blue-green} {RGB}{  0,  073,  073}
\definecolor{cb-green-sea}  {RGB}{  0, 146, 146}
\definecolor{cb-rose}       {RGB}{255, 109, 182}
\definecolor{cb-salmon-pink}{RGB}{255, 182, 119}
\definecolor{cb-purple}     {RGB}{ 73,   0, 146}
\definecolor{cb-blue}       {RGB}{ 0, 109, 219}
\definecolor{cb-lilac}      {RGB}{182, 109, 255}
\definecolor{cb-blue-sky}   {RGB}{109, 182, 255}
\definecolor{cb-blue-light} {RGB}{182, 219, 255}
\definecolor{cb-burgundy}   {RGB}{146,   0,   0}
\definecolor{cb-brown}      {RGB}{146,  73,   0}
\definecolor{cb-clay}       {RGB}{219, 209,   0}
\definecolor{cb-green-lime} {RGB}{ 36, 255,  36}
\definecolor{cb-yellow}     {RGB}{255, 255, 109}

% -------------------------------------------------------------- [ Usage Macro ]

\newcommand{\cbBlack}      [1]{\textcolor{cb-black}      {#1}}
\newcommand{\cbBlueGreen}  [1]{\textcolor{cb-blue-green} {#1}}
\newcommand{\cbGreenSea}   [1]{\textcolor{cb-green-sea}  {#1}}
\newcommand{\cbRose}       [1]{\textcolor{cb-rose}       {#1}}
\newcommand{\cbSalmonPink} [1]{\textcolor{cb-salmon-pink}{#1}}
\newcommand{\cbPurple}     [1]{\textcolor{cb-purple}     {#1}}
\newcommand{\cbBlue}       [1]{\textcolor{cb-blue}       {#1}}
\newcommand{\cbLilac}      [1]{\textcolor{cb-lilac}      {#1}}
\newcommand{\cbBlueSky}    [1]{\textcolor{cb-blue-sky}   {#1}}
\newcommand{\cbBlueLight}  [1]{\textcolor{cb-blue-light} {#1}}
\newcommand{\cbBurgundy}   [1]{\textcolor{cb-burgundy}   {#1}}
\newcommand{\cbBrown}      [1]{\textcolor{cb-brown}      {#1}}
\newcommand{\cbClay}       [1]{\textcolor{cb-clay}       {#1}}
\newcommand{\cbGreenLime}  [1]{\textcolor{cb-green-lime} {#1}}
\newcommand{\cbYellow}     [1]{\textcolor{cb-yellow}     {#1}}

% --------------------------------------------------- [ For code highlighting. ]

\newcommand{\ColourBlindData}    [1]{\textcolor{cb-burgundy}{#1}}
\newcommand{\ColourBlindType}    [1]{\textcolor{cb-blue}{#1}}
\newcommand{\ColourBlindBound}   [1]{\textcolor{cb-rose}{#1}}
\newcommand{\ColourBlindFunction}[1]{\textcolor{cb-green-sea}{#1}}
\newcommand{\ColourBlindKeyword} [1]{{\underline{#1}}}
\newcommand{\ColourBlindImplicit}[1]{{\itshape \IdrisBound{#1}}}
\newcommand{\ColourBlindComment} [1]{{\itshape\textcolor{cb-clay}{#1}}}

\endinput
% ---------------------------------------------------------------------- [ EOF ]
examples/thesis/biblio.bib · 3 KB
@Article{Shannon1946,
  title =	 {{A mathematical theory of communication}},
  author =	 {Shannon, C.E.},
  journal =	 {ACM SIGMOBILE Mobile Computing and Communications
                  Review},
  volume =	 5,
  number =	 1,
  pages =	 {3--55},
  issn =	 {1559-1662},
  year =	 1946,
  publisher =	 {ACM}
}

@article{Dolev1983,
  title={{On the security of public key protocols}},
  author={Dolev, D. and Yao, A.},
  journal={Information Theory, IEEE Transactions on},
  volume={29},
  number={2},
  pages={198--208},
  issn={0018-9448},
  year={1983},
  publisher={IEEE}
}

@article{Shamir1979,
  title={{How to share a secret}},
  author={Shamir, A.},
  journal={Communications of the ACM},
  volume={22},
  number={11},
  pages={612--613},
  issn={0001-0782},
  year={1979},
  publisher={ACM}
}

@article{Needham1978,
  title={{Using encryption for authentication in large networks of computers}},
  author={Needham, R.M. and Schroeder, M.D.},
  journal={Communications of the ACM},
  volume={21},
  number={12},
  pages={993--999},
  issn={0001-0782},
  year={1978},
  publisher={ACM}
}

@article{Rivest1978,
  title={{A method for obtaining digital signatures and public-key cryptosystems}},
  author={Rivest, R.L. and Shamir, A. and Adleman, L.},
  journal={Communications of the ACM},
  volume={21},
  number={2},
  pages={120--126},
  issn={0001-0782},
  year={1978},
  publisher={ACM}
}

@article{Merkle1978,
  title={{Secure communications over insecure channels}},
  author={Merkle, R.C.},
  journal={Communications of the ACM},
  volume={21},
  number={4},
  pages={294--299},
  issn={0001-0782},
  year={1978},
  publisher={ACM}
}

@article{Diffie1976,
  title={{New directions in cryptography}},
  author={Diffie, W. and Hellman, M.},
  journal={Information Theory, IEEE Transactions on},
  volume={22},
  number={6},
  pages={644--654},
  issn={0018-9448},
  year={1976},
  publisher={IEEE}
}

@book{Shannon1949,
  title={{Communication theory of secrecy systems}},
  author={Shannon, C.E.},
  year={1949},
  publisher={AT \& T}
}

@article{Ziv1977,
  title={{A universal algorithm for sequential data compression}},
  author={Ziv, J. and Lempel, A.},
  journal={Information Theory, IEEE Transactions on},
  volume={23},
  number={3},
  pages={337--343},
  issn={0018-9448},
  year={1977},
  publisher={IEEE}
}
@article{Huffman1952,
  title={{A method for the construction of minimum-redundancy codes}},
  author={Huffman, D.A.},
  journal={Proceedings of the IRE},
  volume={40},
  number={9},
  pages={1098--1101},
  issn={0096-8390},
  year={1952},
  publisher={IEEE}
}
@article{Hamming1950,
  title={{Error detecting and error correcting codes}},
  author={Hamming, R.W.},
  journal={Bell System Technical Journal},
  volume={29},
  number={2},
  pages={147--160},
  year={1950}
}
examples/thesis/body.tex · 6 KB
\usepackage[style=alphabetic,natbib=true]{biblatex}
\usepackage{lipsum}

%% ---------------------------------------------------------------- [ Preamble ]

\ExecuteBibliographyOptions{maxnames=3,minnames=2}

% You can customise based on memoir here.

%% ---------------------------------------------------------------- [ Metadata ]
\title{Ninja Thesis}
\author{Hamato Yoshi}
\email{[email protected]}

\date{\origdate\today}

\address{%
First Line\\
Second Line\\
Third Line\\
\url{http://www.somewhere.com}
}

\university{University Name}

% For copyright reasons I do not include the university logo.
\logocmd{\includegraphics[height=0.3\textwidth]{example-image}}

\wordcount{80000}
\degree{Doctor of Philosophy}

\keywordlist{keyword; keyword; keyword}
\startdate{May}{2011}
\finishdate{December}{2015}

\bibliography{biblio.bib}
%% ------------------------------------------------------------------- [ Begin ]
\begin{document}
\maketitle
%% ------------------------------------------------------------- [ Frontmatter ]
\frontmatter
%%
\begin{theabstract}
An abstract of words.
\end{theabstract}

\makedeclaration{} % if custom declaration use declaration environment.
\makecopyrightnoembargo{} % Other copyright statements to be supported in future.


\begin{acknowledgements}
I acknowledge people.

\theAcknowledgementStamp{St Andrews}
\end{acknowledgements}

\cleardoublepage{}

\begin{dedication}
Something snazzy like:
\vspace{3em}

voor het schuim op het bier,\\
voor de nachten plezier\\
voor alle liedjes die ooit zijn bedacht\\
voor het haar op mijn hoofd,\\
voor het vuur dat nooit dooft\\
voor die foto waarop jij naar mij lacht\\
\textit{Halleluja}~\textsc{Jeroen Kant}
\vfill
\end{dedication}

%% --------------------------------------------------------------------- [ TOC ]
\tableofcontents

%% -------------------------------------------------------------- [ Mainmatter ]
\mainmatter{}

% If you are to use latex please use includes.
\chapter{Introduction}
\nocite{*}
\citeauthor{Shannon1946} wrote a cool paper \citep{Shannon1946}. The security of public key protocols has been studied before \citep{Dolev1983}. \citeauthor{Shamir1979} introduces in \citet{Shamir1979} how to share secrets.
There are many interesting papers outthere \citet{Needham1978,Rivest1978,Merkle1978,Diffie1976,Shannon1949,Ziv1977, Huffman1952, Hamming1950}

\begin{fncycomment}
This should only be seen in draft mode.
\end{fncycomment}

\begin{quote}
We few, we happy few, we band of brothers\anote[Bob]{Look Ma' a todo note};
For he to-day that sheds his blood with me
Shall be my brother; be he ne'er so vile,
This day shall gentle his condition:
And gentlemen in England now a-bed
Shall think themselves accursed they were not here,
And hold their manhoods cheap whiles any speaks
That fought with us upon Saint Crispin's day.
\end{quote}

\lipsum{}

\chapter{Method}

Please consider use of the \texttt{csquotes} package, it is loaded by default and helps you with \enquote{quotes}.

\lipsum{}

\begin{theorem}\label{th:a}
Let $a$ and $b$ be in $\mathbb{N}$. Then there exist integers $u$ and $v$, such that
\[
gcd(a,b) = ua+vb.
\]
In particular, if $a$ and $b$ are coprime, there exist integers $u$ and $v$, such tat
\[
ua+vb=1.
\]
\end{theorem}

\begin{lemma}\label{lem:a}
Let $d$ divide a product $ab$ and let the gcd of $d$ and $a$ be 1. Then $d$ divides $b$.
\end{lemma}

\begin{proof}
Since $\mathrm{gcd}(d,a)=1$, Theorem~\ref{th:a} implies that $xd + ya = 1$, for some integers $x$ and $y$.
So, $xdb + yab = b$. Since $d$ divides $ab$, it follows that $d$ also divides $xdb + yab$ which equals $b$.
\end{proof}

\begin{corollary}
let $p$ be prime and let $p$ divide $\prod_{i=1}^{k}a_{i}$, where $a_{i}\in\mathbb{Z}, 1\geq i\geq k$. Then $p$ divides at least one of the factors $a_{i}, 1\geq i\geq k$.
\end{corollary}

\begin{proof}
Use Lemma~\ref{lem:a} and induction on $k$.
\end{proof}

\noindent
A random labelled equation.
\begin{equation}\label{eq:a}
a_{i}\equiv a_{j} \pmod{m}\Rightarrow i=j
\end{equation}

\begin{theorem}[Fermat's Little Theorem]
Let $p$ be a prime number and let $a$ be any integer. Then
\[
a^{p}\equiv a\pmod{p}
\]
\end{theorem}

\begin{definition}
A function $f:\mathbb{N}\rightarrow\mathbb{N}$ is said to be \emph{multiplicative}, if for every pair of positive integers $m$ and $n$
\[
\mathrm{gcd}(m,n)=1\Rightarrow f(m,n)=f(m)f(n)
\]
\end{definition}

\begin{lemma}
Euler's Totient function $\phi(m)$ is multiplicative.
\end{lemma}

\begin{example}
An example
\end{example}

\begin{exercise}
An exercise
\end{exercise}

\begin{problem}
A problem
\end{problem}

\begin{solution}
A solution
\end{solution}

\begin{proposition}
A proposition
\end{proposition}


\begin{definition}
A definition
\end{definition}

\begin{note}
\lipsum[1]
\end{note}

\begin{remark}
\lipsum[1]
\end{remark}

\chapter{Results}

\lipsum{}
\chapter{Discussion}

\begin{quote}
We few, we happy few, we band of brothers\anote[Bob]{Look Ma' a todo note};
For he to-day that sheds his blood with me
Shall be my brother; be he ne'er so vile,
This day shall gentle his condition:
And gentlemen in England now a-bed
Shall think themselves accursed they were not here,
And hold their manhoods cheap whiles any speaks
That fought with us upon Saint Crispin's day.
\end{quote}

\lipsum[2-4]

\chapter{Conclusion}

\lipsum{}

%% ------------------------------------------------------------- [ Back Matter ]
\backmatter
%% ------------------------------------------------------------ [ Bibliography ]
\printbibliography{} % <- biblatex has cool features, I suggest you use them.
%% ----------------------------------------------------------- [ List o' Stuff ]
\cleardoublepage{}
\listoftheorems[ignore={note,remark}]

\end{document}
%% --------------------------------------------------------------------- [ EOF ]
examples/thesis/sta-colours.sty · 2 KB
% ---------------------------------------------------------- [ sta-colours.sty ]
% Module    : sta-colours.sty
% Copyright : (c) Jan de Muijnck-Hughes
% License   : see LICENSE
% Version   : v2016.03.09
% ---------------------------------------------------------------------- [ EOH ]
\ProvidesPackage{sta-colours}

\RequirePackage{xcolor}

\definecolor{sta-blue}{RGB/cmyk}{0,82,155/1.0, 0.68, 0.0, 0.12}
\definecolor{sta-red}{RGB/cmyk}{238,50,36/0.0, 0.95, 1.0, 0.0}
\definecolor{sta-yellow}{RGB/cmyk}{255,238,0/0.0, 0.0, 1.0, 0}
\definecolor{sta-black}{RGB/cmyk}{0,0,0/0.0, 0.0, 0.0, 1.0}
\definecolor{sta-cyan}{RGB/cmyk}{0,174,239/1.0,0.0,0.0,0.0}
\definecolor{sta-orange}{RGB/cmyk}{248,152,29/0.0, 0.48, 1.0, 0.0}
\definecolor{sta-green}{RGB/cmyk}{84,185,72/0.69, 0.0, 1.0, 0}
\definecolor{sta-darkgreen}{RGB/cmyk}{0,89,83/1.0, 0.0, 0.48, 0.68}
\definecolor{sta-purple}{RGB/cmyk}{147,111,177/0.46, 0.63, 0.0, 0.0}
\definecolor{sta-burgundy}{RGB/cmyk}{163,2,52/0.0, 1.0, 0.6, 0.37}
\definecolor{sta-grey}{RGB/cmyk}{113,112,116/0.03, 0.03, 0.0, 0.56}

\newcommand{\stablue}[1]{\textcolor{sta-blue}{#1}}
\newcommand{\stared}[1]{\textcolor{sta-red}{#1}}
\newcommand{\stayellow}[1]{\textcolor{sta-yellow}{#1}}
\newcommand{\stablack}[1]{\textcolor{sta-black}{#1}}
\newcommand{\stacyan}[1]{\textcolor{sta-cyan}{#1}}
\newcommand{\staorange}[1]{\textcolor{sta-orange}{#1}}
\newcommand{\stagreen}[1]{\textcolor{sta-green}{#1}}
\newcommand{\stadarkgreen}[1]{\textcolor{sta-darkgreen}{#1}}
\newcommand{\stapurple}[1]{\textcolor{sta-purple}{#1}}
\newcommand{\staburgundy}[1]{\textcolor{sta-burgundy}{#1}}
\newcommand{\stagrey}[1]{\textcolor{sta-grey}{#1}}

% ---------------------------------------------------------------------- [ EOS ]
\endinput
% ---------------------------------------------------------------------- [ EOF ]
examples/thesis/sta-thesis.cls · 20 KB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright 2015,2016 - Jan de Muijnck-Hughes
%%
%% This work may be distributed and/or modified under the  conditions
%% of the LaTeX Project Public License, either version 1.3c of this
%% license or (at your option) any later version.
%%
%% The latest version of this license can be found at:
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Jan de Muijnck-Hughes
%%
%% This work consists of the file: sta-thesis.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sta-thesis}[2016/05/11 v2016.05.11 sta-thesis]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LaTeX class for producing theses. This style builds upon existing
%% LaTeX packages combining them into a consistent class that is
%% (hopefully) easy to use, making the writing of a thesis easier.
%% Important packages included by default are:
%%   Memoir
%%   todonotes
%%   amsmath
%%   thmtools
%%   csquotes
%%
%% For the full list just scroll down a little further.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Class Options:
%%
%%   customfonts -> Turn of import of default fonts
%%
%%
%% Mutually Exclusive options:
%%
%%   + Thesis Mode.
%%     + draft  -> send draft mode to memoir and todonotes
%%     + final* -> send final mode to memoir and disable todonotes
%%
%%   + Display Mode.
%%     + print*     -> ready thesis for printing.
%%     + electronic -> ready thesis for an electronic version.
%%     + screen     -> ready thesis for displaying in ebooks.
%%
%%   + Linespacing for print version.
%%     + single*  -> Single line spacing
%%     + onehalf  -> 1.5 line spacing
%%     + double   -> Double line spacing
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TODO:
%%
%% Set drafting page styling using Memoir only.
%% Setup KVOptions for booleans.
%%
% ---------------------------------------------------------------------- [ EOH ]
% ------------------------------------------------------------------ [ Options ]

% Line Spacing Options for Print
\newif\ifsingle{}
\newif\ifonehalf{}
\newif\ifdouble{}

% Which display mode are we in.
\newif\ifprinting{}
\newif\ifscreen{}
\newif\ifelectronic{}

% Use custom fonts
\newif\ifcustomfonts{}

% Cover Page
\newif\ifcoverpage{}

% Default boolean values
\printingtrue{}
\screenfalse{}
\electronicfalse{}

\singlefalse{}
\onehalftrue{}
\doublefalse{}

\customfontsfalse{}
\coverpagefalse{}
% --------------------------------------------------------- [ Drafting Options ]
\DeclareOption{draft}{%
  \PassOptionsToClass{draft}{memoir}
}

\DeclareOption{final}{%
  \PassOptionsToClass{final}{memoir}
  \PassOptionsToPackage{disable,colorinlistoftodos}{todonotes}
}
% ----------------------------------------------------- [ Line Spacing Options ]
\DeclareOption{single}{%
  \doublefalse{}
  \onehalffalse{}
  \singletrue{}
}
\DeclareOption{onehalf}{%
  \doublefalse{}
  \onehalftrue{}
  \singlefalse{}
}
\DeclareOption{double}{%
  \doubletrue{}
  \onehalffalse{}
  \singlefalse{}
}
% ----------------------------------------------------- [ Display Mode Options ]
\DeclareOption{screen}{%
  \electronicfalse{}
  \printingfalse{}
  \screentrue{}
  \PassOptionsToClass{pdftex,british,10pt,ebook}{memoir}
}

\DeclareOption{print}{%
  \electronicfalse{}
  \screenfalse{}
  \printingtrue{}
  \PassOptionsToClass{pdftex,british,12pt,a4paper}{memoir}
}

\DeclareOption{electronic}{%
  \printingfalse{}
  \screenfalse{}
  \electronictrue{}
  \PassOptionsToClass{pdftex,british,12pt,a4paper}{memoir}
}
% ------------------------------------------------- [ Custom Font Usage Option ]
\DeclareOption{customfonts}{%
  \customfontstrue{}
}
% ---------------------------------------------------------------- [ Coverpage ]
\DeclareOption{coverpage}{%
  \coverpagetrue{}
}
% --------------------------------------------------------------------- [ Misc ]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
% ---------------------------------------------------------- [ Process Options ]
\ProcessOptions\relax
% ------------------------------------------------------------------- [ Memoir ]
\LoadClass{memoir}
% ----------------------------------------------------------------- [ Packages ]
\RequirePackage[l2tabu,
                orthodox]{nag}
\RequirePackage{etoolbox}
\RequirePackage{microtype}
\RequirePackage{environ}
\RequirePackage{xspace}
\RequirePackage{tocbibind}
\RequirePackage{xcolor}
\RequirePackage[british,iso]{isodate}
\RequirePackage{color,calc,soul,fourier}
\RequirePackage[british]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[strict=true]{csquotes}

\ifcustomfonts%
%
\else
  \RequirePackage[sc]{mathpazo}
  \RequirePackage{helvet}
  \RequirePackage{courier}
  \RequirePackage[T1]{fontenc}
\fi

\RequirePackage{sta-colours}
%% Math Packages
\RequirePackage{amsmath}
\RequirePackage{amsthm}
\RequirePackage{amssymb}
\RequirePackage[fixamsmath]{mathtools}
\RequirePackage{thmtools}
\RequirePackage{thm-restate}
\RequirePackage{fixmath}
\RequirePackage[all,
                error]{onlyamsmath}

\RequirePackage[inline]{enumitem}
\RequirePackage{multirow}
\RequirePackage{multicol}
\RequirePackage[pdftex,final]{graphicx}
\RequirePackage{array}
\RequirePackage{booktabs}
\RequirePackage{enumitem}
\RequirePackage[pdftex]{hyperref}
\RequirePackage{memhfixc}
\RequirePackage{bookmark}
\RequirePackage{tikz}
\RequirePackage[unq]{unique}
%% For Draft Mode
\RequirePackage[obeyDraft,
                colorinlistoftodos,
                textsize=small,
                color=orange!20!white,
                linecolor=black]{todonotes}
\RequirePackage{ifdraft}

% ------------------------------------------------ [ Because..you know...LaTeX ]
\let\@@tikzpicture\tikzpicture
\def\tikzpicture{\catcode`\$=3 \@@tikzpicture}
%% ------------------------------------------------------- [ Metadata Commands ]

\newcommand{\university}[1]{\gdef\@university{#1}}
\newcommand{\theuniversity}[1]{\@university\xspace}
\newcommand{\degree}[1]{\gdef\@degree{#1}}
\newcommand{\thedegree}{\@degree\xspace}
\newcommand{\logocmd}[1]{\gdef\@logocmd{#1}}
\newcommand{\wordcount}[1]{\gdef\@wordcount{#1}}
\newcommand{\thewordcount}{\@wordcount\xspace}
\newcommand{\address}[1]{\gdef\@address{#1}}
\newcommand{\email}[1]{\gdef\@email{%
  \ifprinting%
    \texttt{#1}
  \else%
    \href{mailto:#1}{#1}
  \fi}}
\newcommand{\keywordlist}[1]{\gdef\@keywordlist{#1}}
\newcommand{\startdate}[2]{\gdef\@startmonth{#1}\gdef\@startyear{#2}}
\newcommand{\finishdate}[2]{\gdef\@finishmonth{#1}\gdef\@finishyear{#2}}
\newcommand{\copyrightyear}[1]{\gdef\@copyyear{#1}}

\newcommand{\thestartdate}{\@startmonth~\@startyear}
\newcommand{\thestartmonth}{\@startmonth}
\newcommand{\thestartyear}{\@startyear}

\newcommand{\thefinishdate}{\@finishmonth~\@finishyear}
\newcommand{\thefinishmonth}{\@finishmonth}
\newcommand{\thefinishyear}{\@finishyear}

\newcommand{\thecopyrightyear}{\@copyyear}

\newcommand{\thesigningdate}{{\origdate\thedate}}

\newcommand{\signature}[1]{%
\vspace{3em}
\noindent%
Signature of~#1:\xspace\dotfill\\
\begin{flushright}
  Date:~\thesigningdate{}
\end{flushright}}

\newcommand{\mySignature}{\signature{Candidate}}
\newcommand{\supervisorSignature}{\signature{Supervisor}}

\newcommand{\theAcknowledgementStamp}[1]{%
\vspace{3em}
\begin{flushright}
\theauthor{}\\
#1\\
\thesigningdate{}
\end{flushright}
\vfill}
% ------------------------------------------------------ [ Page Layout Styling ]

\newcommand{\tocChpAdd}[2]{#1\addcontentsline{toc}{chapter}{#2}}
\newcommand{\tocPage}[1]{#1\cleardoublepage}


% ------------------------------------------------------------ [ Draft Styling ]
\ifdraft{
%% Line Numbering
  \RequirePackage[pagewise]{lineno}
  \RequirePackage{geometry}
  \renewcommand{\linenumberfont}{\normalfont\scriptsize\bfseries}
  \setlength{\linenumbersep}{2mm}
  \linenumbers{}
  \modulolinenumbers[2]
  \DoubleSpacing{}
%% Page Layout
  \geometry{%
    asymmetric,
    includeall,
    vmargin=10mm,
    left=10mm,
    rmargin=5mm,
    marginparsep=5mm,
    marginparwidth=55mm
  }
%% Paragraph Styling
  \setlength{\parskip}{1.3ex plus 0.2ex minus 0.2ex}
  \setlength{\parindent}{0pt}
}{%
% ----------------------------------------------------- [ Styling for Printing ]
  \ifprinting
    \settrimmedsize{\stockheight}{\stockwidth}{*}
    \settrims{0pt}{0pt}

    \setlrmarginsandblock{*}{30mm}{1.5}
    \setulmarginsandblock{4cm}{*}{*}                      %

    \setheadfoot{\onelineskip}{2\onelineskip}
    \setheaderspaces{*}{2\onelineskip}{*}

    \ifsingle
      \SingleSpacing{}
    \fi
    \ifonehalf
     \OnehalfSpacing{}
    \fi
    \ifdouble
      \DoubleSpacing{}
    \fi
  \fi
% --------------------------------------------------- [ Styling for Electronic ]
  \ifelectronic
    \settrimmedsize{\stockheight}{\stockwidth}{*}
    \settrims{0pt}{0pt}

    \settypeblocksize{634pt}{448.13pt}{*}
    \setulmargins{4cm}{*}{*}
    \setlrmargins{*}{*}{1}

    \setheadfoot{\onelineskip}{2\onelineskip}
    \setheaderspaces{*}{2\onelineskip}{*}

    \OnehalfSpacing{}
  \fi
% ------------------------------------------------------- [ Styling for Screen ]
  \ifscreen

    \setlength{\parskip}{1.3ex plus 0.2ex minus 0.2ex}
    \setlength{\parindent}{0pt}


    \settrimmedsize{\stockheight}{\stockwidth}{*}
    \settrims{0pt}{0pt}

    \setlrmarginsandblock{*}{0.75in}{1}
    \setulmarginsandblock{0.75in}{*}{*}

    \setheadfoot{\onelineskip}{2\onelineskip}
    \setheaderspaces{*}{2\onelineskip}{*}

    \setmarginnotes{0pt}{0pt}{0pt}

    \OnehalfSpacing{}
\fi
%% Finalise the Layout
  \checkandfixthelayout{}
  \fixpdflayout{}
}

%% ------------------------------------------------ [ Default Look and Feel ]
\setsecnumdepth{subsection}

\settocdepth{section}
\renewcommand{\cftpartnumwidth}{2em}

\newcommand{\theadStyle}{\bfseries\sffamily}
\newcommand{\thead}[1]{{\theadStyle #1}}

%% Printing Dependent styling
\ifprinting
 \selectcolormodel{cmyk}
 \hypersetup{
  linkcolor=black,
  anchorcolor=black,
  citecolor=black,
  urlcolor=black
 }
\else
 \selectcolormodel{RGB}
 \hypersetup{%
  colorlinks=true,
  linkcolor=sta-blue,
  anchorcolor=sta-blue,
  citecolor=sta-blue,
  urlcolor=sta-blue
 }
\fi
%% ---------------------------------------------------------------- [ enumitem ]
% Provide paralist compatible macroes
% TODO Make native
% Within Paragraph lists
\newlist{inparaenum}{enumerate*}{1}
\setlist[inparaenum,1]{label=(\alph*),
before=\unskip{: }, itemjoin={{; }}, itemjoin*={{; and }}
}

\newlist{inparaenumor}{enumerate*}{1}
\setlist[inparaenumor,1]{label=(\alph*),before=\unskip{: }, itemjoin={{; }}, itemjoin*={{; or }}}



\newlist{inparadesc}{description*}{1}
\setlist[inparadesc,1]{%
  font=\bfseries,%
  before=\unskip{: },%
  itemjoin={{; }},%
  itemjoin*={{; and }}%
}

% Compact Lists
\newlist{compactitem}{itemize}{3}
\setlist[compactitem]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}
\setlist[compactitem,1]{label=\textbullet}
\setlist[compactitem,2]{label=--}
\setlist[compactitem,3]{label=*}

\newlist{compactdesc}{description}{3}
\setlist[compactdesc]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}

\newlist{compactenum}{enumerate}{3}
\setlist[compactenum]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}
\setlist[compactenum,1]{label=\arabic*)}
\setlist[compactenum,2]{label=\alph*)}
\setlist[compactenum,3]{label=\roman*)}

%% ------------------------------------------------------------ [ contractions ]

\DeclareRobustCommand\onedot{\futurelet\@let@token\@onedot}
\def\@onedot{\ifx\@let@token.\else.\null\fi\xspace}
\def\eg{{e.g}\onedot}
\def\ie{{i.e}\onedot}
\def\cf{{cf}\onedot}
\def\etc{{etc}\onedot}
\def\vs{{vs}\onedot}
\def\wrt{w.r.t\onedot}
\def\dof{d.o.f\onedot}
\def\etal{{et al}\onedot}

% ----------------------------------------------------------------- [ Graphics ]
\graphicspath{{image/}{figure/}{logo/}}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps}

%% ----------------------------------------------------- [ Epigraph formatting ]
\epigraphposition{flushright}
\epigraphtextposition{flushleftright}
\epigraphsourceposition{flushright}
\setlength{\epigraphwidth}{0.5\textwidth}
%% ---------------------------------------------------------------- [ Abstract ]
\renewcommand{\abstractnamefont}{\sffamily\LARGE\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\normalsize}
\addto\captionsbritish{\renewcommand*\abstractname{Abstract}}

\setlength{\absleftindent}{0pt}
\setlength{\absrightindent}{0pt}

%% ---------------------------------------------- [ Chapter and Heading Styles ]
% Draft
\makepagestyle{draft}

\makeoddhead{draft}{}{}{Draft compiled on \today}
\makeevenhead{draft}{}{}{Draft compiled on \today}

\makeoddfoot{draft}{}{}{Page--\thepage}
\makeevenfoot{draft}{}{}{Page--\thepage}

% Frontpage
\makepagestyle{frontpage}

\makeoddhead{frontpage}{}{}{}
\makeevenhead{frontpage}{}{}{}

\makeoddfoot{frontpage}{}{}{}
\makeevenfoot{frontpage}{}{}{}

% Apply Styling
\ifdraft{%
 \pagestyle{draft}
}{%
 \pagestyle{Ruled}
}

% Headings
\headstyles{komalike}
\chapterstyle{default}

%% ----------------------------------------------------------- [ Theorems ]
\declaretheoremstyle[%
  spaceabove=1em,
  spacebelow=1em,
  headfont=\sffamily\bfseries,
  bodyfont=\normalfont\em,
  postheadspace=0.75em
]{thmstyle}

\declaretheoremstyle[%
  spaceabove=1em,
  spacebelow=1em,
  headfont=\sffamily\bfseries,
  bodyfont=\normalfont,
  postheadspace=0.75em
]{notestyle}

\declaretheoremstyle[%
  spaceabove=1.5em,
  spacebelow=1.5em,
  headfont=\sffamily\bfseries,
  bodyfont=\normalfont\em,
  postheadspace=0.75em
]{hypostyle}

\declaretheorem[%
      numbered=unless unique
    , style=hypostyle
    , name={Hypothesis}
  ]{hypothesis}

\declaretheorem[%
    style=hypostyle,
    name={Sub-Hypothesis}
  ]{subhyp}

\declaretheorem[style=notestyle, starred, name={\textbf{Note}}]{note}
\declaretheorem[style=notestyle, starred, name={\textbf{Remark}}]{remark}
\declaretheorem[style=notestyle, starred, name={\textbf{Aside}}]{aside}

\declaretheorem[style=thmstyle, name={Definition}]{definition}
\declaretheorem[style=thmstyle, name={Example}]{example}
\declaretheorem[style=thmstyle, name={Exercise}]{exercise}
\declaretheorem[style=thmstyle, name={Problem}]{problem}
\declaretheorem[style=thmstyle, name={Question}]{question}
\declaretheorem[style=thmstyle, name={Solution}]{solution}

\declaretheorem[style=thmstyle, name={Corollary}]{corollary}
\declaretheorem[style=thmstyle, name={Lemma}]{lemma}
\declaretheorem[style=thmstyle, name={Proposition}]{proposition}
\declaretheorem[style=thmstyle, name={Theorem}]{theorem}

% --------------------------------------------- [ Glossary Stylings ]
%% TODO

% -------------------------------------------------------------- [ Misc Macros ]

\newcommand{\furl}[1]{\footnote{\url{#1}}}

% ---------------------------------------------- [ TODO Note Macros ]

\newcommand{\addref}{\todo{Add Reference}}

\newcommand{\maybe}[1]{\todo{Should I: #1??}}
\newcommand{\maybecite}{\todo{Should Cite??}}

% nasty hack to get spacing to work
\newcommand{\fixtodo}[2][]{%
\todo[caption={#2}, size=\small, #1]{%
\begin{Spacing}{.75}#2\end{Spacing}}}

\NewEnviron{fncycomment}[1][Comment]{%
\fixtodo[inline, caption={#1}]{%
\begin{minipage}{\linewidth}%
\textbf{\uppercase{#1}}
\BODY{}
\end{minipage}}}

\newcommand{\anote}[2][]{%
\fixtodo{\textbf{\uppercase{#1}}~#2
}}

% ----------------------------------------------- [ Predefined Pages ]


%% Dedication Page
\NewEnviron{dedication}{%
 \thispagestyle{empty}
 \vspace*{0.2\textheight}%
 \begin{flushright}%
 \BODY{}
 \end{flushright}%
 \cleardoublepage{}
}

%% Acknowledgement Page
\NewEnviron{acknowledgements}{%
  \chapter*{Acknowledgements}
  %\addcontentsline{toc}{chapter}{Acknowledgements}
  \BODY{}
  \cleardoublepage{}
}

%% Declaration Page
\NewEnviron{declaration}{%
\thispagestyle{empty}
\BODY{}
\cleardoublepage{}}
%
%% Copyright page
\NewEnviron{permission}{%
\thispagestyle{empty}
\BODY{}
\cleardoublepage{}}

%% Abstract
\NewEnviron{theabstract}{%
\thispagestyle{empty}
  \begin{abstract}
    \BODY{}
  \end{abstract}
\cleardoublepage{}}

%% -------------------------------------------------------------- [ Title Page ]
\renewcommand{\maketitle}{%
 \hypersetup{%
  pdfauthor={\@author},
  pdftitle={\@title},
  pdfkeywords={\@keywordlist}
 }
 \ifcoverpage{}
   \thispagestyle{empty}
   \begin{flushright}
   \vspace*{0.2\textheight}
   {\LARGE \@title}
   \rule{0.9\linewidth}{0.5em}\\[2em]
   {\Large \@author}\\[0.2em]
   {\Large \thefinishmonth~\thefinishyear}
   \vfill
 \end{flushright}
 \cleardoublepage
 \fi
 \begin{titlingpage}
 \centering
 \vspace*{0.025\textheight}
 {\Huge\bfseries\@title }
 \vfill
 {\Large by}
 \vfill
 {\huge\@author}\\[0.1em]
 \vfill
 \@logocmd
 \vfill
 {\Large This thesis is submitted to the}
 \vfill
 {\LARGE\textsc \@university}
 \vfill
 {\Large in partial fulfilment for the degree of}
 \vfill
 {\LARGE\textsc \@degree}
 \vfill
 {\Large submitted on}\\[2em]
 {\Huge\@date}
 \vfill
 \end{titlingpage}
 \thispagestyle{plain}
}


% ------------------------------------------------------------ [ Default Pages ]

\newcommand{\makedeclaration}{%
\begin{declaration}
\section*{Candidate's Declaration}

I, \theauthor{}, hereby certify that this thesis, which is approximately \thewordcount{} words in length, has been written by me, and that it is the record of work carried out by me, or principally by myself in collaboration with others as acknowledged, and that it has not been submitted in any previous application for a higher degree.\\

\noindent
I was admitted as a research student in \thestartdate{}, and as a candidate for the degree of \thedegree{} in \thefinishdate{}; the higher study, for which this is a record, was carried out in the \theuniversity{} between \thestartyear{} and \thefinishyear{}.
\\

\mySignature{}

\section*{Supervisor's Declaration}

I hereby certify that the candidate has fulfilled the conditions of the Resolution and Regulations appropriate for the degree of \thedegree{} in the \theuniversity{} and that the candidate is qualified to submit this thesis in application for that degree.

\supervisorSignature{}
\end{declaration}}

\newcommand{\makecopyrightnoembargo}{%
\begin{permission}
\section*{Permission for Publication}

In submitting this thesis to the University of St Andrews I understand that I am giving permission for it to be made available for use in accordance with the regulations of the University Library for the time being in force, subject to any copyright vested in the work not being affected thereby.
I also understand that the title and the abstract will be published, and that a copy of the work may be made and supplied to any bona fide library or research worker, that my thesis will be electronically accessible for personal or research use unless exempt by award of an embargo as requested below, and that the library has the right to migrate my thesis into new electronic forms as required to ensure continued access to the thesis.
I have obtained any third-party copyright permissions that may be required in order to allow such access and migration, or have requested the appropriate embargo below.
\\

\noindent
The following is an agreed request by candidate and supervisor regarding the publication of this thesis:

\begin{center}
No embargo on any electronic nor print copy.
\end{center}

\mySignature{}
\supervisorSignature{}

\end{permission}}


% ------------------------------------------------------------- [ Hidden Stuff ]
%% Daleif1 Chapter style taken from memoir.

\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
  \sbox\feline@chapter{%
    \resizebox{!}{#1}{\fboxsep=1pt%
      \colorbox{black}{\color{white}\bfseries\sffamily\thechapter}%
    }}%
  \rotatebox{90}{%
    \resizebox{%
      \heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
    {!}{\scshape\so\@chapapp}}\quad%
  \raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
  \sbox\feline@chapter{\feline@chapter@marker[#1]}%
  \makebox[0pt][l]{% aka \rlap
    \makebox[1cm][r]{\usebox\feline@chapter}%
  }}
\makechapterstyle{daleif1}{
  \renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
  \renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{black}}
  \renewcommand\chapternamenum{}
  \renewcommand\printchaptername{}
  \renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
  \renewcommand\afterchapternum{\par\vskip\midchapskip}
  \renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft ##1\par}
}

\endinput
% ------------------------------------------------------------ [ EOF ]
examples/thesis/thesis.draft.tex · 222 B
% ------------------------------------------------------------- [ Draft Thesis ]
\documentclass[draft,print]{sta-thesis}

\input{./body.tex}
% ---------------------------------------------------------------------- [ EOF ]
examples/thesis/thesis.electronic.tex — the file that is compiled · 227 B
%% --------------------------------------------------------------- [ My Thesis ]
\documentclass[final,electronic]{sta-thesis}

\input{./body.tex}
%% --------------------------------------------------------------------- [ EOF ]
examples/thesis/thesis.print.tex · 230 B
%% --------------------------------------------------------------- [ My Thesis ]
\documentclass[final,print,onehalf]{sta-thesis}

\input{./body.tex}
%% --------------------------------------------------------------------- [ EOF ]
examples/thesis/thesis.screen.tex · 223 B
%% --------------------------------------------------------------- [ My Thesis ]
\documentclass[final,screen]{sta-thesis}

\input{./body.tex}
%% --------------------------------------------------------------------- [ EOF ]
sta-colours.sty · 2 KB
% ---------------------------------------------------------- [ sta-colours.sty ]
% Module    : sta-colours.sty
% Copyright : (c) Jan de Muijnck-Hughes
% License   : see LICENSE
% Version   : v2016.03.09
% ---------------------------------------------------------------------- [ EOH ]
\ProvidesPackage{sta-colours}

\RequirePackage{xcolor}

\definecolor{sta-blue}{RGB/cmyk}{0,82,155/1.0, 0.68, 0.0, 0.12}
\definecolor{sta-red}{RGB/cmyk}{238,50,36/0.0, 0.95, 1.0, 0.0}
\definecolor{sta-yellow}{RGB/cmyk}{255,238,0/0.0, 0.0, 1.0, 0}
\definecolor{sta-black}{RGB/cmyk}{0,0,0/0.0, 0.0, 0.0, 1.0}
\definecolor{sta-cyan}{RGB/cmyk}{0,174,239/1.0,0.0,0.0,0.0}
\definecolor{sta-orange}{RGB/cmyk}{248,152,29/0.0, 0.48, 1.0, 0.0}
\definecolor{sta-green}{RGB/cmyk}{84,185,72/0.69, 0.0, 1.0, 0}
\definecolor{sta-darkgreen}{RGB/cmyk}{0,89,83/1.0, 0.0, 0.48, 0.68}
\definecolor{sta-purple}{RGB/cmyk}{147,111,177/0.46, 0.63, 0.0, 0.0}
\definecolor{sta-burgundy}{RGB/cmyk}{163,2,52/0.0, 1.0, 0.6, 0.37}
\definecolor{sta-grey}{RGB/cmyk}{113,112,116/0.03, 0.03, 0.0, 0.56}

\newcommand{\stablue}[1]{\textcolor{sta-blue}{#1}}
\newcommand{\stared}[1]{\textcolor{sta-red}{#1}}
\newcommand{\stayellow}[1]{\textcolor{sta-yellow}{#1}}
\newcommand{\stablack}[1]{\textcolor{sta-black}{#1}}
\newcommand{\stacyan}[1]{\textcolor{sta-cyan}{#1}}
\newcommand{\staorange}[1]{\textcolor{sta-orange}{#1}}
\newcommand{\stagreen}[1]{\textcolor{sta-green}{#1}}
\newcommand{\stadarkgreen}[1]{\textcolor{sta-darkgreen}{#1}}
\newcommand{\stapurple}[1]{\textcolor{sta-purple}{#1}}
\newcommand{\staburgundy}[1]{\textcolor{sta-burgundy}{#1}}
\newcommand{\stagrey}[1]{\textcolor{sta-grey}{#1}}

% ---------------------------------------------------------------------- [ EOS ]
\endinput
% ---------------------------------------------------------------------- [ EOF ]
sta-drafting.sty · 3 KB
% --------------------------------------------------------- [ sta-drafting.sty ]
% Module    : sta-drafting.sty
% Copyright : (c) Jan de Muijnck-Hughes
% License   : see LICENSE
% Version   : v2016.03.09
% ---------------------------------------------------------------------- [ EOH ]
\ProvidesPackage{sta-drafting}
% ------------------------------------------------------------- [ For Drafting ]
%% --------------------------------------------------------- [ Globabl Imports ]
\RequirePackage[obeyDraft,
                colorinlistoftodos,
                textsize=small,
                color=orange!20!white,
                linecolor=black]{todonotes}
\RequirePackage{ifdraft}
\RequirePackage{setspace}
%% ---------------------------------------------------------- [ Setup Drafting ]
\ifdraft{%
%% ----------------------------------------------------------- [ Local Imports ]
\RequirePackage{geometry}
\RequirePackage{fancyhdr}
\RequirePackage{lineno}
\RequirePackage{environ}
%% ---------------------------------------------------------------- [ Headings ]
\fancypagestyle{titlepage}{%
 \fancyhf{}
 \renewcommand\headrulewidth{0pt}
 \fancyfoot[R]{Page--\thepage}
 \fancyhead[R]{Draft compiled on \today}
}
\fancypagestyle{normalpage}{%
\fancyhf{}
 \renewcommand\headrulewidth{0pt}
 \fancyhead[R]{Draft compiled on \today}
 \fancyfoot[R]{Page--\thepage}
}
%% ---------------------------------------------------------- [ Line Numbering ]
\renewcommand{\linenumberfont}{\normalfont\scriptsize\bfseries}
\setlength{\linenumbersep}{2mm}
\linenumbers{}
\doublespacing{}
%% ------------------------------------------------------------- [ Page Layout ]
\geometry{%
   asymmetric,
   includeall,
   vmargin=10mm,
   left=10mm,
   rmargin=5mm,
   marginparsep=5mm,
   marginparwidth=55mm
 }
%% ------------------------------------------------------- [ Paragraph Styling ]
\setlength{\parskip}{1.3ex plus 0.2ex minus 0.2ex}
\setlength{\parindent}{0pt}
%% ---------------------------------------------------------- [ End of Styling ]
}{}
%% --------------------------------------------------------- [ Global Commands ]
\newcommand{\addref}{\todo{Add Reference}}

% nasty hack to get spacing to work
\newcommand{\fixtodo}[2][]{%
\todo[caption={#2}, size=\small, #1]{%
\begin{spacing}{.75}#2\end{spacing}}}

\NewEnviron{fncycomment}[1][Comment]{%
\fixtodo[inline, caption={#1}]{%
\begin{minipage}{\linewidth}%
\textbf{\uppercase{#1}}
\BODY{}
\end{minipage}}}

\newcommand{\anote}[2][]{%
\fixtodo{\textbf{\uppercase{#1}}~#2
}}
%% --------------------------------------------------------------------- [ EOS ]
\endinput
%% --------------------------------------------------------------------- [ EOF ]
sta-thesis.cls · 20 KB
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Copyright 2015,2016 - Jan de Muijnck-Hughes
%%
%% This work may be distributed and/or modified under the  conditions
%% of the LaTeX Project Public License, either version 1.3c of this
%% license or (at your option) any later version.
%%
%% The latest version of this license can be found at:
%%    http://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is Jan de Muijnck-Hughes
%%
%% This work consists of the file: sta-thesis.cls
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{sta-thesis}[2016/05/11 v2016.05.11 sta-thesis]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% LaTeX class for producing theses. This style builds upon existing
%% LaTeX packages combining them into a consistent class that is
%% (hopefully) easy to use, making the writing of a thesis easier.
%% Important packages included by default are:
%%   Memoir
%%   todonotes
%%   amsmath
%%   thmtools
%%   csquotes
%%
%% For the full list just scroll down a little further.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Class Options:
%%
%%   customfonts -> Turn of import of default fonts
%%
%%
%% Mutually Exclusive options:
%%
%%   + Thesis Mode.
%%     + draft  -> send draft mode to memoir and todonotes
%%     + final* -> send final mode to memoir and disable todonotes
%%
%%   + Display Mode.
%%     + print*     -> ready thesis for printing.
%%     + electronic -> ready thesis for an electronic version.
%%     + screen     -> ready thesis for displaying in ebooks.
%%
%%   + Linespacing for print version.
%%     + single*  -> Single line spacing
%%     + onehalf  -> 1.5 line spacing
%%     + double   -> Double line spacing
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% TODO:
%%
%% Set drafting page styling using Memoir only.
%% Setup KVOptions for booleans.
%%
% ---------------------------------------------------------------------- [ EOH ]
% ------------------------------------------------------------------ [ Options ]

% Line Spacing Options for Print
\newif\ifsingle{}
\newif\ifonehalf{}
\newif\ifdouble{}

% Which display mode are we in.
\newif\ifprinting{}
\newif\ifscreen{}
\newif\ifelectronic{}

% Use custom fonts
\newif\ifcustomfonts{}

% Cover Page
\newif\ifcoverpage{}

% Default boolean values
\printingtrue{}
\screenfalse{}
\electronicfalse{}

\singlefalse{}
\onehalftrue{}
\doublefalse{}

\customfontsfalse{}
\coverpagefalse{}
% --------------------------------------------------------- [ Drafting Options ]
\DeclareOption{draft}{%
  \PassOptionsToClass{draft}{memoir}
}

\DeclareOption{final}{%
  \PassOptionsToClass{final}{memoir}
  \PassOptionsToPackage{disable,colorinlistoftodos}{todonotes}
}
% ----------------------------------------------------- [ Line Spacing Options ]
\DeclareOption{single}{%
  \doublefalse{}
  \onehalffalse{}
  \singletrue{}
}
\DeclareOption{onehalf}{%
  \doublefalse{}
  \onehalftrue{}
  \singlefalse{}
}
\DeclareOption{double}{%
  \doubletrue{}
  \onehalffalse{}
  \singlefalse{}
}
% ----------------------------------------------------- [ Display Mode Options ]
\DeclareOption{screen}{%
  \electronicfalse{}
  \printingfalse{}
  \screentrue{}
  \PassOptionsToClass{pdftex,british,10pt,ebook}{memoir}
}

\DeclareOption{print}{%
  \electronicfalse{}
  \screenfalse{}
  \printingtrue{}
  \PassOptionsToClass{pdftex,british,12pt,a4paper}{memoir}
}

\DeclareOption{electronic}{%
  \printingfalse{}
  \screenfalse{}
  \electronictrue{}
  \PassOptionsToClass{pdftex,british,12pt,a4paper}{memoir}
}
% ------------------------------------------------- [ Custom Font Usage Option ]
\DeclareOption{customfonts}{%
  \customfontstrue{}
}
% ---------------------------------------------------------------- [ Coverpage ]
\DeclareOption{coverpage}{%
  \coverpagetrue{}
}
% --------------------------------------------------------------------- [ Misc ]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
% ---------------------------------------------------------- [ Process Options ]
\ProcessOptions\relax
% ------------------------------------------------------------------- [ Memoir ]
\LoadClass{memoir}
% ----------------------------------------------------------------- [ Packages ]
\RequirePackage[l2tabu,
                orthodox]{nag}
\RequirePackage{etoolbox}
\RequirePackage{microtype}
\RequirePackage{environ}
\RequirePackage{xspace}
\RequirePackage{tocbibind}
\RequirePackage{xcolor}
\RequirePackage[british,iso]{isodate}
\RequirePackage{color,calc,soul,fourier}
\RequirePackage[british]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[strict=true]{csquotes}

\ifcustomfonts%
%
\else
  \RequirePackage[sc]{mathpazo}
  \RequirePackage{helvet}
  \RequirePackage{courier}
  \RequirePackage[T1]{fontenc}
\fi

\RequirePackage{sta-colours}
%% Math Packages
\RequirePackage{amsmath}
\RequirePackage{amsthm}
\RequirePackage{amssymb}
\RequirePackage[fixamsmath]{mathtools}
\RequirePackage{thmtools}
\RequirePackage{thm-restate}
\RequirePackage{fixmath}
\RequirePackage[all,
                error]{onlyamsmath}

\RequirePackage[inline]{enumitem}
\RequirePackage{multirow}
\RequirePackage{multicol}
\RequirePackage[pdftex,final]{graphicx}
\RequirePackage{array}
\RequirePackage{booktabs}
\RequirePackage{enumitem}
\RequirePackage[pdftex]{hyperref}
\RequirePackage{memhfixc}
\RequirePackage{bookmark}
\RequirePackage{tikz}
\RequirePackage[unq]{unique}
%% For Draft Mode
\RequirePackage[obeyDraft,
                colorinlistoftodos,
                textsize=small,
                color=orange!20!white,
                linecolor=black]{todonotes}
\RequirePackage{ifdraft}

% ------------------------------------------------ [ Because..you know...LaTeX ]
\let\@@tikzpicture\tikzpicture
\def\tikzpicture{\catcode`\$=3 \@@tikzpicture}
%% ------------------------------------------------------- [ Metadata Commands ]

\newcommand{\university}[1]{\gdef\@university{#1}}
\newcommand{\theuniversity}[1]{\@university\xspace}
\newcommand{\degree}[1]{\gdef\@degree{#1}}
\newcommand{\thedegree}{\@degree\xspace}
\newcommand{\logocmd}[1]{\gdef\@logocmd{#1}}
\newcommand{\wordcount}[1]{\gdef\@wordcount{#1}}
\newcommand{\thewordcount}{\@wordcount\xspace}
\newcommand{\address}[1]{\gdef\@address{#1}}
\newcommand{\email}[1]{\gdef\@email{%
  \ifprinting%
    \texttt{#1}
  \else%
    \href{mailto:#1}{#1}
  \fi}}
\newcommand{\keywordlist}[1]{\gdef\@keywordlist{#1}}
\newcommand{\startdate}[2]{\gdef\@startmonth{#1}\gdef\@startyear{#2}}
\newcommand{\finishdate}[2]{\gdef\@finishmonth{#1}\gdef\@finishyear{#2}}
\newcommand{\copyrightyear}[1]{\gdef\@copyyear{#1}}

\newcommand{\thestartdate}{\@startmonth~\@startyear}
\newcommand{\thestartmonth}{\@startmonth}
\newcommand{\thestartyear}{\@startyear}

\newcommand{\thefinishdate}{\@finishmonth~\@finishyear}
\newcommand{\thefinishmonth}{\@finishmonth}
\newcommand{\thefinishyear}{\@finishyear}

\newcommand{\thecopyrightyear}{\@copyyear}

\newcommand{\thesigningdate}{{\origdate\thedate}}

\newcommand{\signature}[1]{%
\vspace{3em}
\noindent%
Signature of~#1:\xspace\dotfill\\
\begin{flushright}
  Date:~\thesigningdate{}
\end{flushright}}

\newcommand{\mySignature}{\signature{Candidate}}
\newcommand{\supervisorSignature}{\signature{Supervisor}}

\newcommand{\theAcknowledgementStamp}[1]{%
\vspace{3em}
\begin{flushright}
\theauthor{}\\
#1\\
\thesigningdate{}
\end{flushright}
\vfill}
% ------------------------------------------------------ [ Page Layout Styling ]

\newcommand{\tocChpAdd}[2]{#1\addcontentsline{toc}{chapter}{#2}}
\newcommand{\tocPage}[1]{#1\cleardoublepage}


% ------------------------------------------------------------ [ Draft Styling ]
\ifdraft{
%% Line Numbering
  \RequirePackage[pagewise]{lineno}
  \RequirePackage{geometry}
  \renewcommand{\linenumberfont}{\normalfont\scriptsize\bfseries}
  \setlength{\linenumbersep}{2mm}
  \linenumbers{}
  \modulolinenumbers[2]
  \DoubleSpacing{}
%% Page Layout
  \geometry{%
    asymmetric,
    includeall,
    vmargin=10mm,
    left=10mm,
    rmargin=5mm,
    marginparsep=5mm,
    marginparwidth=55mm
  }
%% Paragraph Styling
  \setlength{\parskip}{1.3ex plus 0.2ex minus 0.2ex}
  \setlength{\parindent}{0pt}
}{%
% ----------------------------------------------------- [ Styling for Printing ]
  \ifprinting
    \settrimmedsize{\stockheight}{\stockwidth}{*}
    \settrims{0pt}{0pt}

    \setlrmarginsandblock{*}{30mm}{1.5}
    \setulmarginsandblock{4cm}{*}{*}                      %

    \setheadfoot{\onelineskip}{2\onelineskip}
    \setheaderspaces{*}{2\onelineskip}{*}

    \ifsingle
      \SingleSpacing{}
    \fi
    \ifonehalf
     \OnehalfSpacing{}
    \fi
    \ifdouble
      \DoubleSpacing{}
    \fi
  \fi
% --------------------------------------------------- [ Styling for Electronic ]
  \ifelectronic
    \settrimmedsize{\stockheight}{\stockwidth}{*}
    \settrims{0pt}{0pt}

    \settypeblocksize{634pt}{448.13pt}{*}
    \setulmargins{4cm}{*}{*}
    \setlrmargins{*}{*}{1}

    \setheadfoot{\onelineskip}{2\onelineskip}
    \setheaderspaces{*}{2\onelineskip}{*}

    \OnehalfSpacing{}
  \fi
% ------------------------------------------------------- [ Styling for Screen ]
  \ifscreen

    \setlength{\parskip}{1.3ex plus 0.2ex minus 0.2ex}
    \setlength{\parindent}{0pt}


    \settrimmedsize{\stockheight}{\stockwidth}{*}
    \settrims{0pt}{0pt}

    \setlrmarginsandblock{*}{0.75in}{1}
    \setulmarginsandblock{0.75in}{*}{*}

    \setheadfoot{\onelineskip}{2\onelineskip}
    \setheaderspaces{*}{2\onelineskip}{*}

    \setmarginnotes{0pt}{0pt}{0pt}

    \OnehalfSpacing{}
\fi
%% Finalise the Layout
  \checkandfixthelayout{}
  \fixpdflayout{}
}

%% ------------------------------------------------ [ Default Look and Feel ]
\setsecnumdepth{subsection}

\settocdepth{section}
\renewcommand{\cftpartnumwidth}{2em}

\newcommand{\theadStyle}{\bfseries\sffamily}
\newcommand{\thead}[1]{{\theadStyle #1}}

%% Printing Dependent styling
\ifprinting
 \selectcolormodel{cmyk}
 \hypersetup{
  linkcolor=black,
  anchorcolor=black,
  citecolor=black,
  urlcolor=black
 }
\else
 \selectcolormodel{RGB}
 \hypersetup{%
  colorlinks=true,
  linkcolor=sta-blue,
  anchorcolor=sta-blue,
  citecolor=sta-blue,
  urlcolor=sta-blue
 }
\fi
%% ---------------------------------------------------------------- [ enumitem ]
% Provide paralist compatible macroes
% TODO Make native
% Within Paragraph lists
\newlist{inparaenum}{enumerate*}{1}
\setlist[inparaenum,1]{label=(\alph*),
before=\unskip{: }, itemjoin={{; }}, itemjoin*={{; and }}
}

\newlist{inparaenumor}{enumerate*}{1}
\setlist[inparaenumor,1]{label=(\alph*),before=\unskip{: }, itemjoin={{; }}, itemjoin*={{; or }}}



\newlist{inparadesc}{description*}{1}
\setlist[inparadesc,1]{%
  font=\bfseries,%
  before=\unskip{: },%
  itemjoin={{; }},%
  itemjoin*={{; and }}%
}

% Compact Lists
\newlist{compactitem}{itemize}{3}
\setlist[compactitem]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}
\setlist[compactitem,1]{label=\textbullet}
\setlist[compactitem,2]{label=--}
\setlist[compactitem,3]{label=*}

\newlist{compactdesc}{description}{3}
\setlist[compactdesc]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}

\newlist{compactenum}{enumerate}{3}
\setlist[compactenum]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}
\setlist[compactenum,1]{label=\arabic*)}
\setlist[compactenum,2]{label=\alph*)}
\setlist[compactenum,3]{label=\roman*)}

%% ------------------------------------------------------------ [ contractions ]

\DeclareRobustCommand\onedot{\futurelet\@let@token\@onedot}
\def\@onedot{\ifx\@let@token.\else.\null\fi\xspace}
\def\eg{{e.g}\onedot}
\def\ie{{i.e}\onedot}
\def\cf{{cf}\onedot}
\def\etc{{etc}\onedot}
\def\vs{{vs}\onedot}
\def\wrt{w.r.t\onedot}
\def\dof{d.o.f\onedot}
\def\etal{{et al}\onedot}

% ----------------------------------------------------------------- [ Graphics ]
\graphicspath{{image/}{figure/}{logo/}}
\DeclareGraphicsExtensions{.pdf,.png,.jpg,.eps}

%% ----------------------------------------------------- [ Epigraph formatting ]
\epigraphposition{flushright}
\epigraphtextposition{flushleftright}
\epigraphsourceposition{flushright}
\setlength{\epigraphwidth}{0.5\textwidth}
%% ---------------------------------------------------------------- [ Abstract ]
\renewcommand{\abstractnamefont}{\sffamily\LARGE\bfseries}
\renewcommand{\abstracttextfont}{\normalfont\normalsize}
\addto\captionsbritish{\renewcommand*\abstractname{Abstract}}

\setlength{\absleftindent}{0pt}
\setlength{\absrightindent}{0pt}

%% ---------------------------------------------- [ Chapter and Heading Styles ]
% Draft
\makepagestyle{draft}

\makeoddhead{draft}{}{}{Draft compiled on \today}
\makeevenhead{draft}{}{}{Draft compiled on \today}

\makeoddfoot{draft}{}{}{Page--\thepage}
\makeevenfoot{draft}{}{}{Page--\thepage}

% Frontpage
\makepagestyle{frontpage}

\makeoddhead{frontpage}{}{}{}
\makeevenhead{frontpage}{}{}{}

\makeoddfoot{frontpage}{}{}{}
\makeevenfoot{frontpage}{}{}{}

% Apply Styling
\ifdraft{%
 \pagestyle{draft}
}{%
 \pagestyle{Ruled}
}

% Headings
\headstyles{komalike}
\chapterstyle{default}

%% ----------------------------------------------------------- [ Theorems ]
\declaretheoremstyle[%
  spaceabove=1em,
  spacebelow=1em,
  headfont=\sffamily\bfseries,
  bodyfont=\normalfont\em,
  postheadspace=0.75em
]{thmstyle}

\declaretheoremstyle[%
  spaceabove=1em,
  spacebelow=1em,
  headfont=\sffamily\bfseries,
  bodyfont=\normalfont,
  postheadspace=0.75em
]{notestyle}

\declaretheoremstyle[%
  spaceabove=1.5em,
  spacebelow=1.5em,
  headfont=\sffamily\bfseries,
  bodyfont=\normalfont\em,
  postheadspace=0.75em
]{hypostyle}

\declaretheorem[%
      numbered=unless unique
    , style=hypostyle
    , name={Hypothesis}
  ]{hypothesis}

\declaretheorem[%
    style=hypostyle,
    name={Sub-Hypothesis}
  ]{subhyp}

\declaretheorem[style=notestyle, starred, name={\textbf{Note}}]{note}
\declaretheorem[style=notestyle, starred, name={\textbf{Remark}}]{remark}
\declaretheorem[style=notestyle, starred, name={\textbf{Aside}}]{aside}

\declaretheorem[style=thmstyle, name={Definition}]{definition}
\declaretheorem[style=thmstyle, name={Example}]{example}
\declaretheorem[style=thmstyle, name={Exercise}]{exercise}
\declaretheorem[style=thmstyle, name={Problem}]{problem}
\declaretheorem[style=thmstyle, name={Question}]{question}
\declaretheorem[style=thmstyle, name={Solution}]{solution}

\declaretheorem[style=thmstyle, name={Corollary}]{corollary}
\declaretheorem[style=thmstyle, name={Lemma}]{lemma}
\declaretheorem[style=thmstyle, name={Proposition}]{proposition}
\declaretheorem[style=thmstyle, name={Theorem}]{theorem}

% --------------------------------------------- [ Glossary Stylings ]
%% TODO

% -------------------------------------------------------------- [ Misc Macros ]

\newcommand{\furl}[1]{\footnote{\url{#1}}}

% ---------------------------------------------- [ TODO Note Macros ]

\newcommand{\addref}{\todo{Add Reference}}

\newcommand{\maybe}[1]{\todo{Should I: #1??}}
\newcommand{\maybecite}{\todo{Should Cite??}}

% nasty hack to get spacing to work
\newcommand{\fixtodo}[2][]{%
\todo[caption={#2}, size=\small, #1]{%
\begin{Spacing}{.75}#2\end{Spacing}}}

\NewEnviron{fncycomment}[1][Comment]{%
\fixtodo[inline, caption={#1}]{%
\begin{minipage}{\linewidth}%
\textbf{\uppercase{#1}}
\BODY{}
\end{minipage}}}

\newcommand{\anote}[2][]{%
\fixtodo{\textbf{\uppercase{#1}}~#2
}}

% ----------------------------------------------- [ Predefined Pages ]


%% Dedication Page
\NewEnviron{dedication}{%
 \thispagestyle{empty}
 \vspace*{0.2\textheight}%
 \begin{flushright}%
 \BODY{}
 \end{flushright}%
 \cleardoublepage{}
}

%% Acknowledgement Page
\NewEnviron{acknowledgements}{%
  \chapter*{Acknowledgements}
  %\addcontentsline{toc}{chapter}{Acknowledgements}
  \BODY{}
  \cleardoublepage{}
}

%% Declaration Page
\NewEnviron{declaration}{%
\thispagestyle{empty}
\BODY{}
\cleardoublepage{}}
%
%% Copyright page
\NewEnviron{permission}{%
\thispagestyle{empty}
\BODY{}
\cleardoublepage{}}

%% Abstract
\NewEnviron{theabstract}{%
\thispagestyle{empty}
  \begin{abstract}
    \BODY{}
  \end{abstract}
\cleardoublepage{}}

%% -------------------------------------------------------------- [ Title Page ]
\renewcommand{\maketitle}{%
 \hypersetup{%
  pdfauthor={\@author},
  pdftitle={\@title},
  pdfkeywords={\@keywordlist}
 }
 \ifcoverpage{}
   \thispagestyle{empty}
   \begin{flushright}
   \vspace*{0.2\textheight}
   {\LARGE \@title}
   \rule{0.9\linewidth}{0.5em}\\[2em]
   {\Large \@author}\\[0.2em]
   {\Large \thefinishmonth~\thefinishyear}
   \vfill
 \end{flushright}
 \cleardoublepage
 \fi
 \begin{titlingpage}
 \centering
 \vspace*{0.025\textheight}
 {\Huge\bfseries\@title }
 \vfill
 {\Large by}
 \vfill
 {\huge\@author}\\[0.1em]
 \vfill
 \@logocmd
 \vfill
 {\Large This thesis is submitted to the}
 \vfill
 {\LARGE\textsc \@university}
 \vfill
 {\Large in partial fulfilment for the degree of}
 \vfill
 {\LARGE\textsc \@degree}
 \vfill
 {\Large submitted on}\\[2em]
 {\Huge\@date}
 \vfill
 \end{titlingpage}
 \thispagestyle{plain}
}


% ------------------------------------------------------------ [ Default Pages ]

\newcommand{\makedeclaration}{%
\begin{declaration}
\section*{Candidate's Declaration}

I, \theauthor{}, hereby certify that this thesis, which is approximately \thewordcount{} words in length, has been written by me, and that it is the record of work carried out by me, or principally by myself in collaboration with others as acknowledged, and that it has not been submitted in any previous application for a higher degree.\\

\noindent
I was admitted as a research student in \thestartdate{}, and as a candidate for the degree of \thedegree{} in \thefinishdate{}; the higher study, for which this is a record, was carried out in the \theuniversity{} between \thestartyear{} and \thefinishyear{}.
\\

\mySignature{}

\section*{Supervisor's Declaration}

I hereby certify that the candidate has fulfilled the conditions of the Resolution and Regulations appropriate for the degree of \thedegree{} in the \theuniversity{} and that the candidate is qualified to submit this thesis in application for that degree.

\supervisorSignature{}
\end{declaration}}

\newcommand{\makecopyrightnoembargo}{%
\begin{permission}
\section*{Permission for Publication}

In submitting this thesis to the University of St Andrews I understand that I am giving permission for it to be made available for use in accordance with the regulations of the University Library for the time being in force, subject to any copyright vested in the work not being affected thereby.
I also understand that the title and the abstract will be published, and that a copy of the work may be made and supplied to any bona fide library or research worker, that my thesis will be electronically accessible for personal or research use unless exempt by award of an embargo as requested below, and that the library has the right to migrate my thesis into new electronic forms as required to ensure continued access to the thesis.
I have obtained any third-party copyright permissions that may be required in order to allow such access and migration, or have requested the appropriate embargo below.
\\

\noindent
The following is an agreed request by candidate and supervisor regarding the publication of this thesis:

\begin{center}
No embargo on any electronic nor print copy.
\end{center}

\mySignature{}
\supervisorSignature{}

\end{permission}}


% ------------------------------------------------------------- [ Hidden Stuff ]
%% Daleif1 Chapter style taken from memoir.

\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\def\myhelvetfont{\def\sfdefault{mdput}}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
  \sbox\feline@chapter{%
    \resizebox{!}{#1}{\fboxsep=1pt%
      \colorbox{black}{\color{white}\bfseries\sffamily\thechapter}%
    }}%
  \rotatebox{90}{%
    \resizebox{%
      \heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
    {!}{\scshape\so\@chapapp}}\quad%
  \raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
  \sbox\feline@chapter{\feline@chapter@marker[#1]}%
  \makebox[0pt][l]{% aka \rlap
    \makebox[1cm][r]{\usebox\feline@chapter}%
  }}
\makechapterstyle{daleif1}{
  \renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
  \renewcommand\chaptitlefont{\normalfont\huge\bfseries\scshape\color{black}}
  \renewcommand\chapternamenum{}
  \renewcommand\printchaptername{}
  \renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
  \renewcommand\afterchapternum{\par\vskip\midchapskip}
  \renewcommand\printchaptertitle[1]{\chaptitlefont\raggedleft ##1\par}
}

\endinput
% ------------------------------------------------------------ [ EOF ]
stabs.sty · 10 KB
% ---------------------------------------------------------------- [ stabs.sty ]
% Module    : stabs.sty
% Copyright : (c) Jan de Muijnck-Hughes
% License   : see LICENSE
% Version   : v2016.03.09
% ---------------------------------------------------------------------- [ EOH ]
%%
%% A beamer style for the University of St Andrews.
%%
%% Provides:
%%
%%   + Options for styling
%%     + lecture    :: based upon Warsaw
%%     + conf       :: based upon Berlin
%%     + 'default'  :: based upon Madrid
%%     + customhf   :: custom header and foot
%%     + customhead :: custom head
%%     + customfoot :: custom foot
%%     + notes      :: Produce printable speaker notes
%%     + poster     :: For posters requires beamerposter
%%   + Commands
%%     + Copyrighted graphics commands
%%       + \includegraphicscopyright[<options>]{<file>}{<Copyright Notice>}
%%     + Safe print reference command, assumes biblatex.
%%       + \printReferences{}
%%   + Modifications
%%     + Handout mode produces 4up automatically.
%%     + If notes option is specified handout is 1up with speaker notes
%% ----------------------------------------------------------- [ Begin Package ]
\ProvidesPackage{stabs}
%% ---------------------------------------------------------------- [ Packages ]
\RequirePackage[l2tabu,orthodox]{nag}
\RequirePackage{fixltx2e}
\RequirePackage[british]{babel}
\RequirePackage[strict=true]{csquotes}
\RequirePackage[T1]{fontenc}
\RequirePackage[protrusion=true, expansion=true]{microtype}

\RequirePackage{ifthen}
\RequirePackage{hyperref}
\RequirePackage{graphicx}
\RequirePackage{sta-colours}
\RequirePackage{environ}
%% ----------------------------------------------------------------- [ Options ]
%% Booleans
\newboolean{lecttheme}
\setboolean{lecttheme}{false}

\newboolean{conftheme}
\setboolean{conftheme}{false}

\newboolean{customhead}
\setboolean{customhead}{false}
\newboolean{customfoot}
\setboolean{customfoot}{false}

\newboolean{notes}
\setboolean{notes}{false}

\newboolean{poster}
\setboolean{poster}{false}

%% Options
\DeclareOption{lecture}{\setboolean{lecttheme}{true}}
\DeclareOption{conf}{\setboolean{conftheme}{true}}
\DeclareOption{notes}{\setboolean{notes}{true}}
\DeclareOption{customhead}{\setboolean{customhead}{true}}
\DeclareOption{customfoot}{\setboolean{customfoot}{true}}
\DeclareOption{customhf}{%
  \setboolean{customhead}{true}%
  \setboolean{customfoot}{true}}
\DeclareOption{poster}{\setboolean{poster}{true}}

\ProcessOptions\relax

%% --------------------------------------------------------- [ Poster Requires ]
\ifthenelse{\boolean{poster}}{

\RequirePackage{tgbonum}
\RequirePackage[scaled]{helvet}
\RequirePackage{tgcursor}

\RequirePackage[font=sf]{caption}
\RequirePackage{setspace}
\RequirePackage{footmisc}
\RequirePackage{relsize}

}{}
%% ---------------------------------------------------------------- [ Commands ]
%%
\newbox\mytempbox
\newdimen\mytempdimen
\newcommand\includegraphicscopyright[3][]{%
  \leavevmode\vbox{\vskip3pt\raggedright%
    \setbox\mytempbox=\hbox{\includegraphics[#1]{#2}}%
    \mytempdimen=\wd\mytempbox\box\mytempbox\par\vskip1pt%
    \fontsize{3}{3.5}%
    \selectfont{\color{black!70}{\vbox{\hsize=\mytempdimen#3}}}\vskip3pt}}

\newcommand{\printReferences}{\mode<article>{\printbibliography}}

\newcommand{\email}[1]{\texttt{#1}}
\newcommand{\headerlogo}[1]{\gdef\STABS@CREST{#1}}
\newcommand{\www}[1]{\texttt{#1}}

\graphicspath{{image/},{figure/}}
\DeclareGraphicsExtensions{.pdf,.png,.eps,.gif,.jpg}

%% ----------------------------------------------------------------- [ Styling ]
%% Colour Themes
\hypersetup{bookmarks=true}

%% --------------------------------------------------------- [ Handout Styling ]
\mode<handout>{%
  \RequirePackage{pgfpages}
  \usetheme{Pittsburgh}
  \usecolortheme{dove}
  \usefonttheme{structurebold}

  \ifthenelse{\boolean{notes}}{
% Include speaker notes.
    \pgfpagesuselayout{2 on 1}[letterpaper, border shrink=5mm]
    \setbeameroption{show notes on second screen=bottom}
    \newlength{\parskipbackup}
    \setlength{\parskipbackup}{\parskip}
    \newlength{\parindentbackup}
    \setlength{\parindentbackup}{\parindent}
    \newcommand{\baselinestretchbackup}{\baselinestretch}
    \usetemplatenote{\rmfamily%
      \setlength{\parindent}{1em} \setlength{\parskip}{1ex}%
      \renewcommand{\baselinestretch}{1}%
      \noindent \insertnote%

      \setlength{\parskip}{\parskipbackup}%
      \setlength{\parindent}{\parindentbackup}%
      \renewcommand{\baselinestretch}{\baselinestretchbackup}}}{%
% 4up Handout
    \pgfpagesuselayout{4 on 1}[border shrink=5mm]}

}

%% ---------------------------------------------------- [ Presentation Styling ]
\mode<beamer>{
  \ifthenelse{\boolean{lecttheme}}{%
    \usetheme{Warsaw}%
  }{%
    \ifthenelse{\boolean{conftheme}}{%
      \usetheme[compress]{Berlin}%
    }{%
      \ifthenelse{\boolean{poster}}{\usetheme{Berlin}}{\usetheme{Madrid}}
    }}

%% --------------------------------------------------------------- [ Colouring ]

% Beamer
\usecolortheme[named=sta-blue]{structure}

% Poster Colours
\ifthenelse{\boolean{poster}}{

\setbeamercolor{headline}{fg=black,bg=white}
\setbeamercolor{footline}{fg=white, bg=sta-blue}
\setbeamerfont{footline}{size=\large,series=\tt}
\setbeamercolor{separation line}{bg=sta-grey}

\setbeamercolor*{block title}{fg=white,bg=sta-blue}
\setbeamerfont{block title}{size=\large,series=\bf}
\setbeamercolor{upper separation line head}{fg=sta-grey}

}{}}

\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{itemize items}[rectangle]
\setbeamertemplate{enumerate items}[rectangle]
\setbeamertemplate{sections/subsections in toc}[rectangle]


%% --------------------------------------------- [ Custom Presentation Styling ]
\defbeamertemplate*{frametitle}{Stabs theme}[1][left]{
  \ifbeamercolorempty[bg]{frametitle}{}{\nointerlineskip}%
  \begin{beamercolorbox}[sep=0.3cm, wd=\paperwidth]{frametitle}%
    \usebeamerfont{frametitle}%
    \vbox{}\vskip-1ex%
    \if@tempswa\else\csname beamer@fte#1\endcsname\fi%
    \strut\insertframetitle\hfill
    \raisebox{-1ex}
             [0pt]
             [-\ht\strutbox]{\includegraphics[height=1.75em]{\STABS@CREST}}%
    \strut\par%
    {%
      \ifx%
          \insertframesubtitle\@empty%
        \else{%
          \usebeamerfont{framesubtitle}%
          \usebeamercolor[fg]{framesubtitle}%
          \insertframesubtitle\strut\par%
        }\fi%
    }%
    \vskip-1ex%
    \if@tempswa\else\vskip-.3cm\fi%
    \end{beamercolorbox}}

% http://tex.stackexchange.com/questions/6267/behaviour-of-frametitle-with-raisebox


\ifthenelse{\boolean{customhead}}{%
%% Header => VFILL | Section
  \mode<beamer>{%
    \setbeamertemplate{headline}{\leavevmode%
      \begin{beamercolorbox}
        [wd=\paperwidth,ht=2.25ex,dp=2ex]
        {section in head/foot}%
        \insertsectionnavigationhorizontal{\paperwidth}{\hskip1pt plus1filll}{}%
      \end{beamercolorbox}}}

  \mode<handout>{%
    \setbeamertemplate{headline}{\leavevmode%
      \insertsectionnavigationhorizontal{\paperwidth}{\hskip1pt plus1filll}{}}}
}{}

\ifthenelse{\boolean{customfoot}}{%
%% Custom Footer => Short Date | VFILL| Progress
  \setbeamertemplate{footline}{\leavevmode\hbox{%
      \begin{beamercolorbox}%% Short Date
        [wd=.2\paperwidth,ht=2.25ex,dp=1ex,left]
        {page number in head/foot}%%
        \hspace*{2ex}%
        \usebeamerfont{date in head/foot}%
        \insertshortdate
      \end{beamercolorbox}%
      \begin{beamercolorbox} %% VFILL
        [wd=0.7\paperwidth,ht=2.25ex,dp=1ex,center]
        {page number in head/foot}
      \end{beamercolorbox}%
      \begin{beamercolorbox}%% Progress
        [wd=0.1\paperwidth, ht=2.25ex, dp=1ex, center]
        {page number in head/foot}%
        \insertframenumber{}/\inserttotalframenumber
      \end{beamercolorbox}}\vskip0pt}
}{}

%% -------------------------------------------------------- [ Poster Templates ]
\ifthenelse{\boolean{poster}}{%
  \selectcolormodel{cmyk}

%% Block Styling
\setbeamertemplate{block begin}{
  \vskip.75ex
  \begin{beamercolorbox}[ht=3.5ex,
                         dp=0.5ex,
                         center,
                         leftskip=-1em,
                         colsep*=.75ex]{block title}%
    \usebeamerfont*{block title}%
    {\phantom{Gg}\insertblocktitle}% phantom because of baseline problem
  \end{beamercolorbox}%
  {\ifbeamercolorempty[bg]{block body}{}{\nointerlineskip\vskip-0.5pt}}%
  \usebeamerfont{block body}%
  \begin{beamercolorbox}[leftskip=1em,colsep*=.75ex,sep=0.5ex,vmode]{block body}%
    \ifbeamercolorempty[bg]{block body}{\vskip-.25ex}{\vskip-.75ex}\vbox{}%
  }
  \setbeamertemplate{block end}{
  \end{beamercolorbox}
}

%% header
\setbeamertemplate{headline}{
  \leavevmode
  \begin{beamercolorbox}[wd=\paperwidth]{headline}
    \begin{columns}[T]
      \begin{column}{.3\paperwidth}
         \insertlogo
      \end{column}
      \begin{column}{.675\paperwidth}
        \vskip4ex
        \begin{flushright}
          \usebeamercolor{title in headline}
              {\color{fg}\textbf{\LARGE{\inserttitle}}\\[1em]}
          \usebeamercolor{author in headline}
              {\color{fg}\large{\insertauthor}\\[0.2em]}
          \usebeamercolor{institute in headline}
              {\color{fg}\large{\insertinstitute}}
        \end{flushright}
      \end{column}
      \begin{column}{.02\paperwidth}
      \end{column}
    \end{columns}
  \end{beamercolorbox}}

%% Footer
\setbeamertemplate{footline}{
  \begin{beamercolorbox}[wd=\paperwidth]{upper separation line foot}
    \rule{0pt}{2pt}
  \end{beamercolorbox}

  \begin{beamercolorbox}[ht=4ex,leftskip=1cm,rightskip=1cm]{footline}%
    \insertshortinstitute
    \hfill
    \insertshortauthor
    \vskip1ex
  \end{beamercolorbox}

  \begin{beamercolorbox}[wd=\paperwidth]{lower separation line foot}
    \rule{0pt}{2pt}
  \end{beamercolorbox}
}


}{}
\endinput
%% --------------------------------------------------------------------- [ EOF ]
stabsmemoir.sty · 3 KB
% ---------------------------------------------------------- [ stabsmemoir.sty ]
% Module    : stabsmemoir.sty
% Copyright : (c) Jan de Muijnck-Hughes
% License   : see LICENSE
% Version   : v2016.03.09
% ---------------------------------------------------------------------- [ EOH ]
%%
%% Memoir based beamerarticle notes style.
%%
%% ----------------------------------------------------------- [ Begin Package ]
\ProvidesPackage{stabsmemoir}
%% ---------------------------------------------------------------- [ Packages ]
\RequirePackage{enumitem}
\RequirePackage{memhfixc}
\RequirePackage{sta-colours}

%% ----------------------------------------------------------------- [ Styling ]
\mode<article>{
%% Headers
 \counterwithout{section}{chapter}
 \setsecnumdepth{subsubsection}
 \headstyles{komalike}
 \chapterstyle{madsen}
 \pagestyle{Ruled}

%% margins
 \setlength{\trimtop}{0pt}
 \setlength{\trimedge}{\stockwidth}
 \addtolength{\trimedge}{-\paperwidth}
 \settypeblocksize{634pt}{448.13pt}{*}
 \setulmargins{4cm}{*}{*}
 \setlrmargins{*}{*}{1}
 \setmarginnotes{17pt}{51pt}{\onelineskip}
 \setheadfoot{\onelineskip}{2\onelineskip}
 \setheaderspaces{*}{2\onelineskip}{*}
 \checkandfixthelayout

%% Paragraphs
 \setlength{\parskip}{1.3ex plus 0.2ex minus 0.2ex}
 \setlength{\parindent}{0pt}
 \fixpdflayout

%% ------------------------------------------------------------------- [ Lists ]
\newlist{inparaenum}{enumerate*}{1}
\setlist[inparaenum,1]{label=(\alph*)}

\newlist{inparadesc}{description*}{1}
\setlist[inparadesc,1]{font=\bfseries}

% Compact Lists
\newlist{compactitem}{itemize}{3}
\setlist[compactitem]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}
\setlist[compactitem,1]{label=\textbullet}
\setlist[compactitem,2]{label=--}
\setlist[compactitem,3]{label=*}

\newlist{compactdesc}{description}{3}
\setlist[compactdesc]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}

\newlist{compactenum}{enumerate}{3}
\setlist[compactenum]{topsep=0pt,partopsep=0pt,itemsep=0pt,parsep=0pt}
\setlist[compactenum,1]{label=\arabic*}
\setlist[compactenum,2]{label=\alph*}
\setlist[compactenum,3]{label=\roman*}

%% ------------------------------------------------------------------- [ Title ]
\setlength{\droptitle}{-12em}
\pretitle{%
  \begin{flushright}\LARGE\sffamily
}
\posttitle{%
  \par\end{flushright}
}
\preauthor{%
  \begin{flushright}\large\vskip 0.25em
}
\postauthor{%
  \par\end{flushright}
}
\predate{%
 \begin{flushright}\large
}
\postdate{%
 \par\end{flushright}
}

}
\endinput
%% --------------------------------------------------------------------- [ EOF ]

The first page, as this template compiles today. Click it to enlarge, and again to shrink. Open the file ↗