-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbcrre_assignment.cls
169 lines (144 loc) · 4.91 KB
/
bcrre_assignment.cls
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
% general setup
% known working with LuaLaTeX as complier
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{bcrre_assignment}
\LoadClass[11pt]{book}
%% generally required packages
% most disertations will require these packages
\RequirePackage{amsmath} %equation formatting
\RequirePackage{ragged2e} %fully justified text
\RequirePackage{booktabs} %table styling
\RequirePackage{hyperref} %hyperlinks
\RequirePackage{graphicx} %figures
\RequirePackage{caption} %allows caption formatting
\RequirePackage{subcaption} %allows subfigures
\RequirePackage{geometry} %page sizing and margins
\RequirePackage[backend=biber, style=authoryear-ibid]{biblatex} %referencing
\RequirePackage{titling} %title page
\RequirePackage{fontspec} %fonts
\RequirePackage{fancyhdr} %headers and footers
\RequirePackage{titlesec} %formatting for headings
\RequirePackage[base]{babel} %language typesetting
\RequirePackage{siunitx} %typesetting for numbers and units
%% more specialist packages
\RequirePackage[table,xcdraw]{xcolor} %allow colour in tables
\RequirePackage{pgfplots} %plotting tool
\RequirePackage{lipsum} %allows for filler Lorem Ipsum text
\RequirePackage{minted} % typesetting of code
\RequirePackage{afterpage} % landscape table
\RequirePackage{pdflscape} % landscape table
\RequirePackage{csvsimple} % import data from csv
%% template setup
% geometry - page size and margins
\geometry{a4paper, left=2cm, right=2cm, top=2cm, bottom=3cm}
% hyperref - turn off link highlighting
\hypersetup{hidelinks}
% biblatex - adjust url formatting in references section
\setcounter{biburllcpenalty}{7000}
\setcounter{biburlucpenalty}{8000}
% set table of contents name
\renewcommand{\contentsname}{Table of Contents}
% pgfplots - set the version to run
\pgfplotsset{compat=1.18}
% fontspec - set the document fonts
\setmainfont{Manrope}[ % serif font (title page and headings)
Path=font/manrope/,
Scale=1,
UprightFont=*-Regular.ttf,
BoldFont=*-Bold.ttf,
ItalicFont=*-LightItalic.otf,
BoldItalicFont=*-BoldItalic.otf
]
\setsansfont{Larken}[ % serif font (title page and headings)
Path=font/larken/,
Scale=1,
Extension = .ttf,
UprightFont=*-Regular,
BoldFont=*-Bold,
ItalicFont=*-Italic,
BoldItalicFont=*-BoldItalic
]
% fancyhdr - headers and footers
% fancy page style (most pages)
\pagestyle{fancy}
\fancyhead{}
\fancyhead[L]{\leftmark}
\fancyfoot{}
\fancyfoot[R]{\thepage}
\fancyfoot[L]{Student ID: \studentidnumber}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\setlength{\headheight}{13.7pt}
% plain page style (first pages of chapters)
\fancypagestyle{plain}{
\fancyhead{} % clear header
\fancyhead[L]{\leftmark}
\fancyfoot{} % clear footer
\fancyfoot[R]{\thepage}
\fancyfoot[L]{Student ID: \studentidnumber}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.4pt}
}
%titlesec - format and spacing for each level of title
%%% chapter
\titleformat{\chapter}
{\sffamily\LARGE\bfseries\filright}{\thechapter}{1em}{}{}
\titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
%%% section
\titleformat{\section}
{\sffamily\Large\bfseries\filright}{\thesection}{1em}{}{}
\titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
%%% subsection
\titleformat{\subsection}
{\sffamily\large\bfseries\filright}{\thesubsection}{1em}{}{}
\titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
%%% subsubsection
\titleformat{\subsubsection}
{\sffamily\normalsize\bfseries\filright}{\thesubsubsection}{1em}{}{}
\titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex}
% Redefine blank page to include text saying it's intentional
\makeatletter
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
\hbox{}
\vspace*{\fill}
\begin{center}
\textbf{(This page left blank intentionally)}
\end{center}
\vspace{\fill}
\thispagestyle{empty}
\newpage
\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother
% set the format of the title page
\renewcommand{\maketitle}{
\begin{titlepage}
\begin{center}
\vspace*{1cm}
\Huge
{\sffamily \bfseries{University of Birmingham}}
\vspace{1cm}
\LARGE
{\sffamily
College of Engineering and Physical Sciences
\vspace{0.5cm}
School of Engineering
\vspace{0.5cm}
Birmingham Centre for Railway Research and Education
\vspace{0.5cm}
MSc in Railway Systems Engineering and Integration
}
\vspace{1.5cm}
\includegraphics[width=0.4\textwidth]{images/uob_logo.pdf}
\vfill
{\sffamily
\textbf{Module Name:} \modulename
\vspace{0.5cm}
\textbf{Assignment Title:} \assignmenttitle
\vspace{1cm}
\textbf{Student ID Number:} \studentidnumber
\vspace{0.5cm}
\textbf{Date Submitted:} \datesubmitted
}
\end{center}
\end{titlepage}
}