summaryrefslogtreecommitdiff
path: root/report/stacs_cw.cls
blob: a5d74058f4b31832a012a14d0741e992b400486a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
% Style file for producing University of St Andrew's Computer Science report - 2018
% Work-in-Progress [Last Updated: 2018-11-05]

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{stacs_cw}[St Andrews' Computer Science coursework template]

%% Load article as base class
\LoadClass[a4paper,11pt]{article}
%% Layout
\RequirePackage[a4paper,headheight=14pt,width=150mm,top=25mm,bottom=25mm]{geometry}
\RequirePackage{graphicx}
\RequirePackage{setspace}
\RequirePackage{float}
%Font
\RequirePackage{libertine}
\RequirePackage{libertinust1math}
\RequirePackage{inconsolata}
%% Language and Encoding
\RequirePackage[UKenglish]{babel}
\RequirePackage[utf8]{inputenc}
\RequirePackage[T1]{fontenc}
%% Formatting
\RequirePackage{microtype}
\RequirePackage{xcolor}
\RequirePackage{hyperref}
\RequirePackage{parskip}
%% Feature inclusion
\RequirePackage{listings}
\RequirePackage{fancyhdr}
% Title
\RequirePackage{titletoc}
\RequirePackage{titlesec}
%% Maths
\RequirePackage{amsmath}
\RequirePackage{amssymb}
% Bibliography
\RequirePackage{natbib}
%% Colours
\definecolor{st-a-gray}{gray}{0.95}
\definecolor{st-a-blue}{HTML}{00539b}
\definecolor{st-a-red}{HTML}{ee312a}
\definecolor{st-a-yellow}{HTML}{ffdf00}
\definecolor{st-a-black}{HTML}{231f20}
\definecolor{st-a-light-blue}{HTML}{00aeef}
\definecolor{st-a-mid-blue}{HTML}{007dc5}
\definecolor{st-a-burgundy}{HTML}{c60c46}
\definecolor{st-a-purple}{HTML}{7b439a}
\definecolor{st-a-orange}{HTML}{f5842b}
\definecolor{st-a-green}{HTML}{54b948}
\definecolor{st-a-mid-green}{HTML}{00853f}
\definecolor{st-a-dark-green}{HTML}{005953}
%% Hyperlink colouring
\hypersetup{
    colorlinks=true,
    linkcolor=st-a-blue,
    filecolor=st-a-burgundy,
    urlcolor=cyan,
}
%% Code Listing style
\lstset{
    basicstyle=\small\ttfamily,
    columns=flexible,
    breaklines=true,
    backgroundcolor=\color{st-a-gray},
    numberstyle=\ttfamily,
    frame=tb
}
%% Matriculation Number
\def\matrno#1{\def\@matrno{#1}}
\newcommand{\printmatrno}{\@matrno}
%% Code command listing
\def\code#1{\colorbox{st-a-gray}{\texttt{#1}}}
%% File listing
\def\file#1{\textcolor{st-a-burgundy}{\texttt{#1}}}
%% Main matter header style
\pagestyle{fancy}
\rhead{\printmatrno}
\renewcommand{\sectionmark}[1]{\markright{#1}} %% Suppress section numbering in lhead
%% Define default document text colour
\color{st-a-black}
%% Title page
\def\@maketitle{
    \pagestyle{empty}
    \null
    \vspace{0.3\textheight}
    \begin{center}
        {\LARGE\bfseries \@title \par}
        \vskip 1.5em
        {\Large \@matrno}
        \vskip 1.em
        {\Large \@date}
    \end{center}
    \newpage
    \clearpage
    \pagenumbering{arabic} 
}
% Table of Contents
\renewcommand\tableofcontents{
    \null\hfill\textbf{\Large\contentsname}\hfill\null\par
    \@mkboth{\MakeUppercase\contentsname}{\MakeUppercase\contentsname}%
    \thispagestyle{empty}
    \@starttoc{toc}%
    \newpage
    \clearpage
    \pagenumbering{arabic}
}