-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
236 lines (182 loc) · 5.51 KB
/
main.tex
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
\newif\ifthesis \thesistrue
\newif\ifpublish \publishtrue
\documentclass[12pt]{article}
\bibliographystyle{apalike}
\include{langs}
%packages!
\usepackage{lastpage}
\usepackage{comment}
\usepackage{setspace}
\usepackage{datetime}
\usepackage{array}
\usepackage{color}
\definecolor{lightgray}{rgb}{.9,.9,.9}
\definecolor{darkgray}{rgb}{.4,.4,.4}
\definecolor{purple}{rgb}{0.65, 0.12, 0.82}
\usepackage{anyfontsize}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{geometry}
\usepackage[document]{ragged2e}
\usepackage{parskip}
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage{caption}
\DeclareCaptionFormat{myformat}{\footnotesize\selectfont#1#2#3}
\captionsetup{justification=raggedright, singlelinecheck=false, format=myformat}
\usepackage{layout}
\RequirePackage{csquotes}
\RequirePackage{xpatch}
\RequirePackage[
datamodel=xamkbibdm,
backend=biber,
bibstyle=authoryear,
citestyle=authoryear,
dashed=false,
uniquename=init,
giveninits=true,
labeldate=long,
urldate=long,
dateabbrev=false,
defernumbers=true,
maxnames=2,
maxbibnames=99,
]{biblatex}
\setlength\bibitemsep{0.5\baselineskip}
\setlength\bibhang{0pt}
% Biblatex bibliography format modifications
\renewbibmacro{in:}{} % Beware of titles with "In:"
\DeclareNameAlias{sortname}{family-given}
\renewcommand*\finalnamedelim{\addspace\&\addspace}
\DeclareFieldFormat{titlecase}{#1}
\DeclareFieldFormat{editortype}{\mkbibparens{#1}\nopunct}
\xpatchbibmacro{bbx:editor}{\addcomma\space}{\space}{}{}
\DeclareLabeldate{
\field{date}\field{year}\field{eventdate}\field{origdate}\literal{No date}}
\xpatchbibmacro{date+extrayear}
{\printtext[parens]}
{\setunit*{\addperiod\addspace}\printtext}{}{}
\xpatchbibmacro{date+extradate}
{\printtext[parens]}
{\setunit*{\addperiod\addspace}\printtext}{}{}
\DeclareFieldFormat{lastmoddate}{Updated #1}
\DeclareFieldFormat{url}{Available at: \url{#1}}
\DeclareFieldFormat{pages}{#1}
\DeclareFieldFormat{urldate}{\mkbibbrackets{Accessed #1}}
\DeclareFieldFormat{title}{#1}
\DeclareFieldFormat[article]{title}{#1}
\xpretobibmacro{url+urldate}{
\iffieldundef{doctype}%
{\iffieldundef{url}{}{WWW document. }}
{\printfield{doctype}\setunit*{\addperiod\addspace}}
\iffieldundef{lastmodyear}
{}%
{\printlastmoddate\setunit*{\addperiod\addspace}}%
}{}{}
\providecommand\phantomsection{}
\addbibresource{uni.bib}
%Setting the font
\renewcommand{\rmdefault}{phv} % Arial
\renewcommand{\sfdefault}{phv} % Arial
%Enter parameters here
\newcommand{\myauthor}{Khoa Vo}
\newcommand{\mytitle}{\ifthesis Relational conditionals with pseudo-functions \else Firewall analysis assistant in miniKanren \fi}
\newcommand{\subtitle}{\ifthesis Techniques in miniKanren \else \fi}
\newcommand{\rpas}{\ifthesis Bachelor's thesis \else Report \fi}
\newcommand{\degree}{Degree programme in Information Technology}
\newcommand{\course}{\ifthesis \else Advanced Sever Development Project \fi}
%Line spacing is 1.5
\linespread{1.5}
%Redefining maketitle
\renewcommand{\maketitle}{
\thispagestyle{empty}
\newgeometry{right=2cm, left=2cm, top=4cm, bottom=2cm}
\begin{center}
\fontsize{16}{19} \selectfont \myauthor
\vspace{20pt}
\MakeUppercase{\fontsize{24}{30}\selectfont\mytitle} \\
\fontsize{20}{25}\selectfont\subtitle
\vspace{20pt}
\ifthesis
\fontsize{16}{19} \selectfont {\rpas \\ \degree}
\else
\fontsize{16}{19} \selectfont {\rpas \\ \course}
\fi
\vspace{20pt}
\the\year
%Adding the logo
\vspace{100pt}
\includegraphics{figures/logo.jpg}
\end{center}
%Making the cover background
\tikz[remember picture,overlay] \node[inner sep=0pt] at (current page.center){
\includegraphics[width=\paperwidth,height=\paperheight]{figures/coverbg.png}};
\clearpage
}
%Formatting The sections:
\titleformat{\section}
{\bfseries}
{\thesection}
{.17in}
{\MakeUppercase}
%The subsection:
\titleformat{\subsection}
{\bfseries}
{\thesubsection}
{.17in}
{}
%Formatting the paragraphs
%Put new line between paragraphs
\setlength{\parskip}{\baselineskip}
%No indentation
\setlength{\parindent}{0pt}
%Content of the document
\begin{document}
%The cover page
%First we must clear up the margin
{\maketitle}
%Abstract & Table of content:
\ifthesis\input{abstract}\else\fi
\newgeometry{right=2cm, left=2cm, top=2cm, bottom=2cm}
\thispagestyle{empty}
{\tableofcontents}
\newpage
%Body layout
\newgeometry{right=2cm, left=4.3cm, top=2.25cm, bottom=1.25cm}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[C]{\thepage}
%The below line was marked with "b"
%===========================================================================================================
%CONTENT GOES HERE!
\lstset{language=Scheme, showstringspaces=false, breaklines=true}
\ifpublish
\input{intro}
\input{prelim}
\ifthesis \input{reif} \input{staticKanren} \else \input{firewall} \fi
\input{ccs}
\else
\ifthesis \input{prelim} \else \input{firewall} \fi
\fi
%\section{Applications}
%\section{Conclusion}
%References, this was marked with "r"
%---------------------------------------------------------------------------------------------------------------
%These two should always go together
\newpage
\begingroup
% NO more line spacing for references
\linespread{1}
% Set spacing between bibliography spacing
\setlength\bibitemsep{\baselineskip}
% NO more hanging indentation for bibliograpy
\setlength{\bibhang}{0pt}
\section*{REFERENCES}
\phantomsection
\addcontentsline{toc}{section}{REFERENCES}
\printbibliography[heading=none]
\endgroup
\end{document}