-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
226 lines (174 loc) · 9.09 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
\documentclass[a4paper, 12pt, openany]{book} %chose the paper size and font size. Openany ensures that all all chapters and similar may begin at any page, not only odd pages. For the introductory pages and appendices we want openany, but for chapter pages in the main content we want chapters to begin only on odd pages (right hand side). The book class ensures that the margins are automatically adjusted such that left hand pages are slightly moved to the left and vice versa at the right, which makes the thesis very readable and good looking when printed in bound book format.
\usepackage[utf8]{inputenc} %to manage special characters
\usepackage[T1]{fontenc} %to manage special characters
\usepackage[Bjarne]{fncychap} %fancy chapter style (many more available, like Sonny or Lenny etc.)
\usepackage{fancyhdr} %to customize the headers
\usepackage[lmargin=1.5in, rmargin=1in, tmargin=1in, bmargin=1in]{geometry} %sets the margins for the pages
\setcounter{tocdepth}{2} %table of contents number depth for subsections (2 = x.x.x)
\setcounter{secnumdepth}{4} %numbering depth for headers for subsections in the text(4 = x.x.x.x)
\usepackage{url} %to include urls
\usepackage{listings} %include this if you want to include code in the thesis
\usepackage{amsmath,amssymb} %mathematical package
\usepackage{siunitx} %includes SI-units
\usepackage[bf]{caption} %makes float captions bold
\usepackage{array, booktabs} %to make better tables\
\usepackage{svg}
\usepackage{dirtree}
\newcommand{\ts}{\textsuperscript}
\usepackage{graphicx} %to include graphics
\usepackage{float} %to include floats
\usepackage[export]{adjustbox} %to adjust floats
\usepackage{subfig} %to include subfigures
\usepackage{chngcntr} %will make it possible to change the counter for tables, figures etc. such as below
\counterwithin{figure}{section} %change counter for figures within sections (also possible to choose for each chapter
\counterwithin{table}{section} %change counter for tables within sections
\usepackage{color, xcolor} %edit e.g. text colors
\usepackage{pdfpages}
%%% For the notes
\usepackage{todonotes}
%%%
\usepackage{titletoc} % Another content list for the appendix
\usepackage{pgfplots} % For the plots
\pgfplotsset{compat=1.9}
\usepackage[backend = biber,
style = numeric,
date = long, % Long: 24th Mar. 1997 | Short: 24/03/1997
sorting = none,
maxcitenames = 3, % max names to include before et. al.
]{biblatex} %customize the look of your citations and bibliography
\addbibresource{bibliography.bib} %declare the bibliography resource
\usepackage{comment} %to be able to comment out sections in the .tex files
\usepackage{afterpage} %to customize page commands such as below
\newcommand\myemptypage{
\null
\thispagestyle{empty}
\addtocounter{page}{-1}
\newpage
} %sets new page command to insert an empty page without adding to the page counter or having a page number
\usepackage{tocbasic} % To solve the spacing problem that we had, like here https://tex.stackexchange.com/questions/187180/spacing-problem-at-list-of-figures
\DeclareTOCStyleEntry[dynnumwidth]{tocline}{figure} % for figure entries
\DeclareTOCStyleEntry[dynnumwidth]{tocline}{table} % for table entries
\usepackage{hyperref}
\hypersetup{ % Color of hyper-references
colorlinks,
citecolor = black,
filecolor = black,
linkcolor = black,
urlcolor = black
}
\begin{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\begin{comment}
% The title page:
% For NTNU students this page will be generated automatically when submitting your paper, and should not be included in the final file from Latex. Delete or comment out the title page setup. The final report should then start with the first page being the abstract. I have included a title page here so it is possible to see how it may look like, and for those who does not get an automatically generated title page. Of course you will need to change the names and titles etc. to your case.
% the title page should be an odd page (right hand side)
\begin{titlepage}
\newgeometry{left=1.6in, right=2in}
\vspace*{1.5cm}
\noindent \textcolor{gray}{\large
Kasper Nilssen \\
Marko Stančić \\
Tor Anders Trondsgård \\
Daniel K. Bjørdal} \\
\vspace{1cm}
\noindent \textbf{\Large Configuration Management for Complex Cloud Operations} \\
\vspace{0.5cm}
\vspace{6.75cm}
\noindent Bachelor’s thesis in Computer Science\\
Supervisor: Rune Volden \\
May 22\ts{nd} 2023 \\
\vspace{0.2cm}
\noindent Norwegian University of Science and Technology \\
Faculty of Information Technology and Electrical Engineering \\
Department of ICT and Natural Sciences \\
\begin{figure}[h]
% \includegraphics[width=0.28\textwidth]{Figures/ntnu_basic.png}
% \includesvg[inkscapelatex=false,width=0.28\textwidth]{Figures/NTNU-logo.svg}
\includesvg[inkscapelatex=false,width=0.38\textwidth]{Figures/NTNU-logo-variant2.svg}
\end{figure}
\end{titlepage}
\restoregeometry
\myemptypage % empty page so that the abstract starts at the first right hand side after the title page
%\end{comment}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The pre-chapters
\chapter*{Abstract} %pre-chapters should not be numbered, hence the "*"
\setcounter{page}{1}
\pagenumbering{roman} %introductory pages should be roman
\addcontentsline{toc}{chapter}{\protect\numberline{}Abstract} %add the chapter to the table of contents, this is not automatically added when creating unnumbered chapters (*). Add it in a chapter style, and keep all chapters on the same numberline indent regardless of number or not on the chapter
\input{Chapters/00Abstract} %insert the chapter text from the files
\chapter*{Sammendrag}
\setcounter{page}{2}
\addcontentsline{toc}{chapter}{\protect\numberline{}Sammendrag} %add the chapter to the table of contents, this is not automatically added when creating unnumbered chapters (*). Add it in a chapter style, and keep all chapters on the same numberline indent regardless of number or not on the chapter
\input{Chapters/00Sammendrag}
\chapter*{Acknowledgments}
\setcounter{page}{3}
\addcontentsline{toc}{chapter}{\protect\numberline{}Acknowledgments}
\input{Chapters/01Acknowledgments}
\tableofcontents
% \setcounter{page}{4}
\addcontentsline{toc}{chapter}{\protect\numberline{}Contents}
%add to table of contents list of figures and tables, and insert list of figures and tables
% \setcounter{page}{6}
\addcontentsline{toc}{chapter}{\protect\numberline{}\listfigurename}
\listoffigures
% \setcounter{page}{7}
\addcontentsline{toc}{chapter}{\protect\numberline{}\listtablename}
\listoftables
% \setcounter{page}{8}
\chapter*{Abbreviations}
\addcontentsline{toc}{chapter}{\protect\numberline{}Abbreviations}
\input{Chapters/02Abbreviations}
\newpage
\myemptypage
%add an empty non-counted page by the command below in order to get the first chapter on the left hand side, if needed (check your page number so that the first chapter is on an odd page)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Customize the layout of the main content of your thesis
\pagestyle{fancy} %set customized page style for header
\fancyhf{} %clear header and footer fields
\renewcommand{\headrulewidth}{0pt} %set to no rule
\fancyhead[LE, RO]{\thepage} %set the page number at left for even, right for odd pages
\fancyhead[RE, LO]{\leftmark} %set the chapter name at right for even, left for odd pages
%is is possible to design the header with the chapter as you wish, e.q. only the chapter or only the name, all lowercase instead etc.
%you could also design the footer if you wish, for example:
%\fancyfoot[LE, RO]{\thepage}
\setlength{\headheight}{14.49998pt} %set the header height
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%main content
\pagenumbering{arabic}
\chapter{Introduction}
\input{Chapters/03Introduction}
\cleardoublepage
%the cleardoublepage command ensures that the next text page is on the right-hand side (odd page) and produces a blank page if necessary to achieve that, as all chapters should begin on the right hand side
\chapter{Theory}
\input{Chapters/04Theory}
\cleardoublepage
\chapter{Methods}
\input{Chapters/05Method}
\cleardoublepage
\chapter{Results}
\input{Chapters/05Results}
\cleardoublepage
\chapter{Discussion}
\input{Chapters/06Discussion}
\cleardoublepage
\chapter{Conclusion and further work}
\input{Chapters/07Conclusion}
\cleardoublepage
\chapter{Societal impact}
\input{Chapters/08Societal_Impact}
\cleardoublepage
\addcontentsline{toc}{chapter}{\protect\numberline{}References}
\printbibliography[title={References}] %you may change the title in the toc here if you want
\cleardoublepage
\chapter*{\LARGE \textbf{Appendices}}
\fancyhf{} %clear the header, it should be empty for the appendices
\renewcommand{\headrulewidth}{0pt} %no rule
\fancyfoot[C]{\thepage} %set the page numbers in the center of the footer instead
%it is possible to set a different page numbering style for the appendix, but I personally just continued with the same page numbering as the main content as I find that more tidy
%\pagenumbering{roman}
%\setcounter{page}{1}
\addcontentsline{toc}{chapter}{\protect\numberline{}Appendices}
\appendix
\input{Chapters/09Appendix}
\end{document}