-
Notifications
You must be signed in to change notification settings - Fork 4
/
ukhthesis.cls
357 lines (286 loc) · 11.3 KB
/
ukhthesis.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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
% Set up the document
\LoadClass[a4paper, 12pt, oneside]{report}
\usepackage{lmodern}
\usepackage{chngcntr}
\usepackage{graphicx}
\usepackage[RGB,table,xcdraw]{xcolor}
\usepackage{fontspec}
\usepackage{ragged2e}
\usepackage{fancyhdr}
\usepackage{titlesec}
\usepackage{amsmath}
\usepackage{titletoc}
\usepackage{xstring}
\usepackage{etoolbox}
\usepackage{enumitem}
\usepackage[acronym,nonumberlist,symbols]{glossaries}
\usepackage{mathabx}
\usepackage[fleqn]{nccmath}
\usepackage[hidelinks]{hyperref}
\usepackage{multirow}
\usepackage{colortbl}
\usepackage{hhline}
\usepackage{natbib}
\usepackage{vcell}
\pagestyle{fancy}
% Set the margins
\usepackage[margin=0cm]{geometry} %showframe
\geometry{left=3cm,right=2.50cm,top=2.50cm,bottom=2.50cm}
\setlength{\footskip}{1.25cm}
\raggedright
% Set the line spacing and Main Font
\linespread{1.5}
\setmainfont{Arial}
% Set the cover page
\newcommand{\cover}[4]{
\begin{titlepage}
\centering
\includegraphics[width=0.4\textwidth]{figures/logo.png} \\[1cm]
{{\fontsize{18}{20}\textbf{\thesisTitle}}}\\
{\fontsize{18}{20}\textbf{\thesisSubtitle}} \\[2.5cm]
{\fontsize{12}{14}\textit{By:}} \\
{{\fontsize{16}{18}\textbf{\thesisAuthor}}} \\ [2cm]
{University of Kurdistan Hewlêr\\Erbil, Kurdistan}\\[2cm]
{\fontsize{13}{15}BSc\\\thesisDate}
\end{titlepage}
}
% Set the title page
\newcommand{\ukhtitlepage}[8]{
\begin{titlepage}
\centering
\includegraphics[width=0.4\textwidth]{figures/logo.png}\\ [-0.75cm]
{\fontsize{18}{20}\textbf{\thesisTitle}}\\
{\fontsize{18}{20}\textbf{\thesisSubtitle}} \\[1cm]
\fontsize{12}{14}\textit{By}\\
{\fontsize{16}{18}\textbf{\thesisAuthor}}\\
{\fontsize{12}{14}Student Number: {\studentNumber}}\\[1cm]
\fontsize{12}{14}\textit{A thesis submitted in partial fulfillment of the requirements for the degree of}\\
\fontsize{14}{16}{Bachelor of Science in {\studentMajor}}\\[1cm]
{\fontsize{13}{15}Department of {\studentDepartment}}\\
{\fontsize{13}{15}School of {\studentSchool}}\\
{\fontsize{13}{15}University of Kurdistan Hewlêr}\\[1cm]
{\fontsize{13}{15}BSc}\\
{\fontsize{13}{15}{\thesisDate}}\\
{\fontsize{13}{15}Erbil, Kurdistan}
\end{titlepage}
}
% Set the footer style
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
% Set page number to the center based on margin, not page size
\fancyfoot[C]{\hspace*{\dimexpr(\textwidth-\marginparwidth)/8\relax}\thepage}
% Set the declaration page
\newcommand{\declaration}[2]{
% start the page count from II and set the format to roman
\pagenumbering{Roman}
\setcounter{page}{2}
\chapter*{Declaration}
\addcontentsline{toc}{chapter}{Declaration}
{\fontsize{12}{14}
\begin{justify}
I hereby declare that this dissertation/thesis entitled: “{#1}“ is my own original work and hereby certify that unless stated, all work contained within this is my own independent research and has not been submitted for the award of any other degree at any institution, except where due acknowledgment is made in the text.
\end{justify}}
\vspace{1cm}
{\fontsize{12}{14}Signature:} \\ [0.25cm]
{\fontsize{12}{14}Name: {\thesisAuthor}} \\ [0.25cm]
{\fontsize{12}{14}Date:}
\clearpage
}
% Set the supervisor's certificate page
\newcommand{\supervisorCertificate}[0]{
\chapter*{Supervisor's Certificate}
\addcontentsline{toc}{chapter}{Supervisor's Certificate}
{\fontsize{12}{14}
This dissertation/thesis has been written under my supervision and has been submitted for the award of the degree of ‘Bachelor of Science’ in ‘{\studentMajor}’ with my approval as supervisor.
}\\
\vspace{1cm}
\rule{8.2cm}{0.5pt} \hspace{1cm} \rule{6cm}{0.5pt} \\
{\fontsize{12}{14}Signature} \hspace{7.55cm}
{\fontsize{12}{14}Name} \\ [1cm]
\rule{8.2cm}{0.5pt} \hspace{1cm} \\
{\fontsize{12}{14}Date} \\ [1cm]
{\fontsize{12}{14}\textbf{I confirm that all the requirements have been fulfilled.}} \\ [1.5cm]
\rule{8.2cm}{0.5pt} \hspace{1cm} \rule{6cm}{0.5pt} \\
{\fontsize{12}{14}Signature} \hspace{7.55cm}
{\fontsize{12}{14}Name} \\ [1cm]
\rule{8.2cm}{0.5pt} \hspace{1cm} \rule{6cm}{0.5pt} \\
{\fontsize{12}{14}Head of Department of} \hspace{5.1cm}
{\fontsize{12}{14}Date} \\ [1cm]
{\fontsize{12}{14}\textbf{I confirm that all the requirements have been fulfilled.}} \\ [1.5cm]
\rule{8.2cm}{0.5pt} \hspace{1cm} \rule{6cm}{0.5pt} \\
{\fontsize{12}{14}Signature} \hspace{7.55cm}
{\fontsize{12}{14}Name} \\ [1cm]
\rule{8.2cm}{0.5pt} \hspace{1cm} \rule{6cm}{0.5pt} \\
{\fontsize{12}{14}Dean of School of} \hspace{6cm}
{\fontsize{12}{14}Date}
\clearpage
}
% Ser the examining committee certification page
\newcommand{\examiningCommittee}[0]{
\chapter*{Examining Committee Certification}
\addcontentsline{toc}{chapter}{Examining Committee Certification}
{\fontsize{12}{14}
\begin{justify}
We certify that we have read this dissertation/thesis: "{{\thesisTitle} {\thesisSubtitle}}" and as a committee have examined the student: "{\thesisAuthor}" in its content and what is related to it. We approve that it meets the standards of a dissertation/thesis for the degree of BSc in {\studentMajor}.
\end{justify}}
\vspace{1cm}
\begin{tabular}{@{}l l}
\rule{6cm}{0.5pt} & \hspace{1cm} \rule{6cm}{0.5pt} \\
{\fontsize{12}{14}Signature} & \hspace{1cm} {\fontsize{12}{14}Signature} \\
{\fontsize{12}{14}Name:} & \hspace{1cm} {\fontsize{12}{14}Name:} \\
{\fontsize{12}{14}Chairman} & \hspace{1cm} {\fontsize{12}{14}Supervisor} \\
{\fontsize{12}{14}Date} & \hspace{1.1cm}{\fontsize{12}{14}Date} \\
\end{tabular}
\vspace{1.5cm}
\begin{tabular}{@{}l l}
\rule{6cm}{0.5pt} & \\
{\fontsize{12}{14}Signature} & \\
{\fontsize{12}{14}Name:} & \\
{\fontsize{12}{14}Member} & \\
{\fontsize{12}{14}Date} & \\
\end{tabular}
\clearpage
}
% Set the dedication page
\newcommand{\dedication}[2]{
\chapter*{Dedication}
\addcontentsline{toc}{chapter}{Dedication}
{\fontsize{12}{14}
\begin{justify}
{#2}
\end{justify}}
\vspace{1cm}
{\fontsize{12}{14}{\thesisAuthor}} \\ [0.25cm]
{\fontsize{12}{14}{#1}}
\clearpage
}
% Format chapter titles
\titlespacing*{\chapter}{0pt}{-27pt}{10pt}
\titleformat{\chapter}[block]
{\fontsize{16}{18}\bfseries}{Chapter \thechapter}{5pt}{}
% Format section titles
\titlespacing*{\section}{0pt}{0pt}{5pt}
\titleformat{\section}
{\fontsize{14}{16}\bfseries}{\thesection}{5pt}{}
% Format subsection titles
\titlespacing*{\subsection}{0pt}{0pt}{2.5pt}
\titleformat{\subsection}
{\fontsize{12}{14}\bfseries}{\thesubsection}{5pt}{}
% Number of sections and subsections
\setcounter{secnumdepth}{3}
\numberwithin{section}{chapter}
\numberwithin{subsection}{section}
% Set table of contents style.
\renewcommand*\contentsname{Table of Contents}
% if the page number is not a roman character for chapters, don't show the dots.
\titlecontents{chapter}[0em]{\addvspace{10pt}}{Chapter \thecontentslabel\hspace{5pt}}{\hspace*{0em}}{\titlerule*[5pt]{{\IfInteger{\thecontentslabel}{}{.}}}{\contentspage}}
% {{\IfInteger{\thecontentslabel}{}{\contentspage}}}} use this to hide the number
% section and subsection style for toc
\titlecontents{section}[2.5em]{\addvspace{10pt}}{\thecontentslabel\hspace{5pt}}{\hspace*{0em}}{\titlerule*[5pt]{.}\contentspage}
\titlecontents{subsection}[5em]{\addvspace{10pt}}{\thecontentslabel\hspace{5pt}}{\hspace*{0em}}{\titlerule*[5pt]{.}\contentspage}
\titlecontents{subsubsection}[5em]{\addvspace{10pt}}{\thecontentslabel\hspace{5pt}}{\hspace*{0em}}{\titlerule*[5pt]{.}\contentspage}
% Set the list of tables
\titlecontents{table}[0em]{\addvspace{10pt}}{Table \thecontentslabel\hspace{5pt}}{\hspace*{0em}}{\titlerule*[5pt]{.}\contentspage}
% Set the list of figures
\titlecontents{figure}[0em]{\addvspace{10pt}}{Figure \thecontentslabel\hspace{5pt}}{\hspace*{0em}}{\titlerule*[5pt]{.}\contentspage}
% This removes the extra gap between tables from different chapters
\makeatletter
\patchcmd{\@chapter}
{\addtocontents{lot}{\protect\addvspace{10\p@}}}
{}
{}{}
\makeatother
% Set the glossary style
\newglossarystyle{custom}
{
\renewcommand*{\glossentry}[2]{%
\item[\glsentrytext{##1}] ##2
\glsentryitem \textbf{--} \glossentrydesc{##1}\par
}
}
\setglossarystyle{custom}
% comment the line below to disable glossaries
\makeglossaries
% Workaround (Part 1) to fix the issue with \glsaddall adding an extra page before the glossary
\newcommand{\newglossarypredefine}[0]{
\setcounter{page}{1}
\renewcommand{\thepage}{G\arabic{page}}
\addcontentsline{toc}{chapter}{Glossary}
}
% Workaround (Part 2) to fix the issue with \glsaddall adding an extra page before the glossary
\newcommand{\newprintglossary}[0]{
\glsaddall
\let\oldclearpage\clearpage
\let\clearpage\relax
\printglossary
\let\clearpage\oldclearpage
\restoregeometry
}
% Set the list of abbreviations and symbols style
\let\svitem\item%
\def\mybox#1{\makebox[2.5cm][l]{\bfseries#1}}
\newenvironment{leftitemize}
{\renewcommand\item[1][$\bullet$]{\svitem[\mybox{##1}]}%
\begin{itemize}[leftmargin=\dimexpr2.5cm+\labelsep]}{\end{itemize}}
\let\origaddvspace\addvspace
% Sets the list of contents, tables, figures, abbreviations, and symbols
\newcommand{\lists}[0]{
\tableofcontents
\setcounter{page}{8}
\addcontentsline{toc}{chapter}{Table of Contents}
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\include{prelude/list_of_abbreviations.tex}
\include{prelude/list_of_symbols.tex}
}
% Set bullet point and numbering style
\setlist[itemize]{label=\bullet, leftmargin=1.0cm}
\setlist[enumerate]{label=\arabic*, leftmargin=1.0cm}
\setlist[itemize,1]{label=$\bullet$}
\setlist[itemize,2]{label=$\circ$}
\setlist[itemize,3]{label=$\sqbullet$}
\setlist[enumerate,1]{label={\arabic*.}}
\setlist[enumerate,2]{label={\alph*.}}
\setlist{itemsep=0.1ex}
% Number equations within individual chapters
\numberwithin{equation}{chapter}
\makeatletter
\let\oldtagform@\tagform@
\renewcommand\tagform@[1]{\maketag@@@{\ignorespaces#1\unskip\@@italiccorr}}
\renewcommand{\eqref}[1]{\textup{\oldtagform@{\ref{#1}}}}
\makeatother
% Set the figure and table caption style
\usepackage{floatrow}
\usepackage[font=small]{caption}
\floatsetup[table]{capposition=top}
% Defines a new end page taking the name used to define the chapter and the letter that is set before the pagination number
\newcommand{\newendpage}[2]{
\chapter*{#1}
\setcounter{page}{1}
\renewcommand{\thepage}{#2\arabic{page}}
\addcontentsline{toc}{chapter}{#1}
}
% Defines a new appendix chapter (takes appendix chapter sequential occurrence number)
\newcommand{\newappendices}[0]{
\chapter*{Appendices}
\setcounter{page}{1}
\renewcommand{\thepage}{A\arabic{page}}
\addcontentsline{toc}{chapter}{Appendices}
}
% no compression on pdf generation
\special{dvipdfmx:config z 0}
% Adds paragraph space and removes indent
\usepackage[skip=8pt]{parskip}
\newcommand{\newendline}[0]{
\par \noindent
}
\usepackage{forloop}
% Making sure agsm harvard style is not bolding urls
\makeatletter
\def\harvardurl#1{Available at: \textit{\textless#1\textgreater}}
\makeatother