-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmain.tex
378 lines (301 loc) · 9.63 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
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
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
\documentclass[11pt,titlepage,openright]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[british]{babel}
\usepackage{graphicx}
\usepackage[dvipsnames]{xcolor}
\usepackage[sb]{libertine}
\usepackage[scale=0.9]{inconsolata}
\usepackage[sf]{titlesec}
\usepackage[square,sort,colon,authoryear]{natbib}
%\usepackage[export]{adjustbox}
\usepackage{
marginnote, % Improved margin notes
environ,
ragged2e, % Justified text in the margin notes
url, % For typesetting URLs
listings, % Code formatting
hyperref, % Links in PDF from TOC, refs, etc.
lipsum,
booktabs,
changepage,
float,
dingbat
}
\renewcommand{\bfdefault}{bx}
\DeclareTextFontCommand\textsb{\libertineSB}
\usepackage[capitalise]{cleveref}
\Crefname{section}{\S}{\S\S}
\usepackage{enumitem} % Improved lists
% \setlist{noitemsep} % To make all lists compact
\setlist[itemize]{itemsep=0pt}
\setlist[itemize,1]{label=--}
\setlist[itemize,2]{label=\ensuremath{\triangleright}}
\setlist[itemize,3]{label=\RED{AVOID}}
% Description lists to use semibold labels
\setlist[description]{font=\libertineSB}
\usepackage[twoside,labelfont=sf]{caption}
\captionsetup{justification=raggedright,singlelinecheck=false}
\newcommand\myhrulefill[1]{\leavevmode\leaders\hrule height#1\hfill\kern0pt}
\DeclareCaptionFormat{FigFormat}{{\color{black}\myhrulefill{0.5pt}}\\#1#2#3}
\captionsetup[figure]{format=FigFormat}
\captionsetup[table]{format=FigFormat}
\DeclareCaptionFormat{LstFormat}{\textsf{Listing}~\arabic{chapter}.\arabic{listing}:#2#3}
\floatstyle{ruled}
\newfloat{listing}{thp}{lol}[chapter]
\floatname{listing}{Listing}
\captionsetup[listing]{format=LstFormat}
\NewEnviron{MarginNote}[1][0mm]{\marginnote{\footnotesize\justifying\BODY}[#1]}
\newcommand{\Footnote}[2][0mm]{\footnotemark\marginnote{\footnotesize$^{\arabic{footnote})}$~#2}[#1]}
\renewenvironment{figure*}[1][]{%
\begin{figure}[#1]%
% This feature is deprecated for now
% \checkoddpage%
% \ifoddpage%
% \begin{adjustwidth}{0cm}{-45mm}%%
% \else%
% \begin{adjustwidth}{-45mm}{0cm}%%
% \fi%
}{%
% \end{adjustwidth}%
\end{figure}}
\renewenvironment{table*}[1][]{%
\begin{table}[#1]%
% This feature is deprecated for now
% \checkoddpage%
% \ifoddpage%
% \begin{adjustwidth}{0cm}{-45mm}%%
% \else%
% \begin{adjustwidth}{-45mm}{0cm}%%
% \fi%
}{%
% \end{adjustwidth}%
\end{table}}
\renewenvironment{listing*}[1][]{%
\begin{listing}[#1]%
% This feature is deprecated for now
% \checkoddpage%
% \ifoddpage%
% \begin{adjustwidth}{0cm}{-45mm}%%
% \else%
% \begin{adjustwidth}{-45mm}{0cm}%%
% \fi%
}{%
% \end{adjustwidth}%
\end{listing}}
%% == Code =======================================================
\lstnewenvironment{Code}[1][style=std]{\lstset{#1}}{}
\lstnewenvironment{Code_Numbered}[1][style=std,numbers=left]{\lstset{#1}}{}
\renewcommand{\c}[1]{\lstinline[style=std]@#1@}
\lstdefinestyle{std}{
language=java,
basicstyle=\small\tt\color{black},
keywordstyle=\small\tt\bfseries,
numberstyle=\footnotesize\sf\color{black},
commentstyle=\small\color{black}\it,
aboveskip=1ex,
belowskip=1ex,
tabsize=2,
columns=fullflexible,
xleftmargin=1ex,
resetmargins=true,
showstringspaces=false,
morecomment=[l]{//},
morecomment=[l]{--},
morecomment=[s]{/*}{*/},
escapeinside=@@,
morekeywords={Frobies},
moredelim=[is][\textit]{___}{___},
moredelim=[is][\textbf]{__*}{*__},
numberbychapter=true
}
\usepackage[activate={true,nocompatibility},final,tracking=true,kerning=true,spacing=true,factor=1100,stretch=10,shrink=10]{microtype}
\usepackage[paper=a4paper,text={13cm,24cm},marginparsep=5mm,marginparwidth=45mm,inner=20mm,twoside]{geometry}
\newcommand{\RED}[1]{\textcolor{red}{#1}}
\newcommand{\ie}{\emph{i.e.,}}
\newcommand{\eg}{\emph{e.g.,}}
\newcommand{\etal}{\emph{et~al.}}
\usepackage{pifont}
\newcommand{\Yes}{\ding{51}}
\newcommand{\No}{\ding{55}}
\renewcommand{\bfdefault}{b}
\clearpage{\pagestyle{empty}\cleardoublepage}
%% You can remove this line if you compile with --synctex=1 (see Makefile)
\synctex=1
\pagestyle{plain}
\begin{document}
\frontmatter
\title{Thesis Template}
\author{Tobias Wrigstad}
\date{\today}
\maketitle
\vspace*{3cm}
\section*{Abstract}
\RED{Replace this with the actual abstract. Obviously.}
Suspendisse luctus leo et porta mattis. In semper, nisi et
suscipit iaculis, leo urna laoreet lacus, ut laoreet lorem tellus
eget dui. Vestibulum eu auctor nisi. Morbi pharetra euismod velit
ac mattis. Maecenas tempor vitae augue ut aliquam. Nunc auctor,
nibh at imperdiet finibus, ex leo semper lacus, ac vehicula quam
nisl condimentum leo.
\tableofcontents
\listoffigures
\listoftables
\mainmatter
\chapter{Introduction}
\lipsum[1]
\begin{MarginNote}[3cm]
\lipsum[2]
\RED{Use linebreaks\-to\-insert\-hyphens\-where\-needed\-in the margin.}
\end{MarginNote}
Footnotes\Footnote[-1cm]{Like this one. Note the manual vertical offset in the source code.} will go into the margin. They should be used sparingly.
\begin{itemize}[label=\leftpointright]
\item The \texttt{enumitem} package will help you customise lists
\item Like weird labels like this
\begin{itemize}
\item Try \texttt{texdoc enumitem} on your command line if you
have a local \LaTeX{} installation (and have your mind blown)
\end{itemize}
\end{itemize}
You can use \texttt{cleveref} to cross-reference in your text.
For chapters, it will produce something like this: \Cref{cha:background}.
For sections, it will produce something like this: \Cref{sec:purpose-goals}.
\lipsum[3]
\section{Purpose and Goals}
\label{sec:purpose-goals}
\lipsum[4-6]
\begin{itemize}
\item FWIW, this is my favourite list label for unordered lists. I
find bullets too ``clumsy.'' If you do not like it, you can
override the default settings (see the source).
\item But your thesis is your thesis. And, ofc, don't use words
like FWIW, ofc, and don't in a thesis text.
\begin{itemize}
\item You can nest lists if you want.
\begin{itemize}
\item But do not go overboard.
\end{itemize}
\end{itemize}
\end{itemize}
This is how you typeset descriptions:
\begin{description}
\item[Beach Boys] \lipsum[1]
\item[The Ronettes] \lipsum[2]
\end{description}
Enumerated lists:
\begin{enumerate}
\item One
\item Two
\end{enumerate}
Note that you can resume lists.
\begin{enumerate}[resume]
\item One
\item Two \label{lst:two}
\end{enumerate}
And reference back to individual list items, \eg{}~\cref{lst:two}.
\section{Thesis Outline}
\label{sec:thesis-outline}
\lipsum[7]
\begin{figure}[t]
\begin{center}
\vspace*{1em}
\verb+\includegraphics[width=0.9\linewidth]{image.pdf}+
\vspace*{1em}
\end{center}
\caption{This is a figure, it will be placed top-most of a page (if possible).}
\label{fig:example-1}
\end{figure}
\begin{figure*}[t]
\begin{center}
\vspace*{1em}
\verb+\includegraphics[width=0.9\linewidth]{image.pdf}+
\vspace*{1em}
\end{center}
\caption[Check the source to see how to customise a figure's LoF entry.]{This is a wider figure, it too will be placed top-most of a page (if possible).}
\label{fig:example-2}
\end{figure*}
\begin{table}[b]
\caption{This is a table, it will be placed at the bottom of a
page (if possible). Note that captions for tables are placed
\emph{above} the table.}
\begin{center}
\begin{tabular}{lll}
\toprule
$A$ & $B$ & $C$ \\
\midrule
$A$ & \multicolumn{2}{c}{$B-C$} \\
$A$ & \Yes{} & \No{} \\
\bottomrule
\end{tabular}
\end{center}
\label{tab:example-1}
\end{table}
\chapter{Background}
\label{cha:background}
This chapter typically contains a discussion of the related work.
BibTeX is a great way to manage bibliography information. If you
use Emacs, tools like RefTeX will help you insert references into
your code. Given that we are not constrained for space, we can use
citations that look like this: \citep{Acm_Curriculum_2013,
CWE_193}. To give the text a bit better flow, you can sometimes
work them into the text. Using numbered references is allowed but
it will cause them to be much like Dijkstra's
\citeyearpar{Dijkstra_1968} dreaded GOTO's.
\chapter{Methodology}
\lipsum[1] Code \c{int inline = ++x;} looks like so:
\begin{Code}
public class HelloWorld<T> extends Something<T> {
public static void main(String[] args) {
System.out.println("Hello, world!");
}
}
\end{Code}
You can also get it with line numbers:
\begin{Code_Numbered}
public class HelloWorld<T> extends Something<T> {
public static void main(String[] args) {
System.out.println("Hello, world!"); @\label{code:hello}@
}
}
\end{Code_Numbered}
You can refer to lines like this: \verb+\cref{code:hello}+ (gives you \cref{code:hello}, see source for more details).
Verbatim text is set in a monospaced typewriter font:
\begin{verbatim}
----------,
| ASCII art!
'--> (*)
\end{verbatim}
\lipsum[2-4]
\begin{table}[!h]
\caption{bar}
\label{tab:bar}
\end{table}
\begin{listing*}[t]
\begin{Code_Numbered}
public class HelloWorld<T> extends Something<T> {
public static void main(String[] args) {
System.out.println("Hello, world!"); @\label{code:hello:2}@
}
}
\end{Code_Numbered}
\caption{If you like, you can have code listings inside a \c{listing} float.}
\label{lst:foo}
\end{listing*}
Referencing Listing~\ref{lst:foo}.
Probably better to use cleveref: \cref{lst:foo}.
\chapter{Design}
\lipsum
\chapter{Implementation}
\lipsum
\chapter{Evaluation}
\lipsum
\chapter{Conclusions}
\lipsum
\bibliographystyle{plainnat}
\bibliography{main}
\end{document}
%%% Local Variables: ***
%%% mode: latex ***
%%% TeX-master: "main.tex" ***
%%% ispell-local-dictionary: "british" ***
%%% End: ***