-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tex
407 lines (331 loc) · 15.6 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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
% Welcome to the University of Helsinki Master's thesis of Sampo Vesanen. This is the main document of this thesis, which sets up the software packages and document properties and calls individual tex files (thesis chapters) to complete this multifile LaTeX project. Please find below some links which I used as a basis in the technical structure of the thesis. Additionally, I have extensively commented the thesis in appropriate places to establish programmatical aspects of this LaTeX project.
% Multifile LaTeX project:
%%% https://www.overleaf.com/learn/latex/Multi-file_LaTeX_projects
%%% https://en.wikibooks.org/wiki/LaTeX/Modular_Documents
% How to write a thesis in LaTeX
%%% https://www.overleaf.com/learn/latex/How_to_Write_a_Thesis_in_LaTeX_(Part_1):_Basic_Structure
% Microtype for thesis:
%%% http://www.khirevich.com/latex/microtype/
% Multilanguage code adaptation from:
%%% https://tex.stackexchange.com/q/42784/182586
% NB: It can be argued that the \documentclass should be {report} for a thesis
\documentclass[a4paper,11pt]{article}
% Set margins -----------------------------------------------------------
\usepackage{geometry}
\geometry{a4paper,total={170mm,257mm},left=20mm,right=20mm,}
% Font and layout settings ----------------------------------------------
\usepackage[activate={true,nocompatibility},tracking=true,kerning=true,factor=1100,stretch=10,shrink=10]{microtype}
\usepackage[finnish,english]{babel} % Set languages. Last in list is main language
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[font=small,labelfont=bf,labelsep=period]{caption}
\usepackage{ragged2e} % Justify text. Command: \justify
\usepackage{lastpage} % Get amount of pages
\usepackage{color} % Enable \textcolor{}{}
\usepackage{minted} % Format and highlight code
\usepackage{enumitem} % Control layout of itemize, enumerate, description
\usepackage{pdfpages} % pdf graphics
\renewcommand{\baselinestretch}{1.5} % Set line spacing
\setlength{\abovecaptionskip}{15pt plus 3pt minus 2pt}
\setlength{\belowcaptionskip}{15pt plus 3pt minus 2pt}
\usepackage{csquotes} % Enable displayquote
% Appendices settings ----------------------------------------------------
\usepackage[toc,title]{appendix}
% Remove individual appendices from ToC, but at the same time protect the viewing of list of figures and tables
\appto\appendices{\addtocontents{toc}{\protect\setcounter{tocdepth}{0}}}
\appto\listoffigures{\addtocontents{lof}{\protect\setcounter{tocdepth}{1}}}
\appto\listoftables{\addtocontents{lot}{\protect\setcounter{tocdepth}{1}}}
\renewcommand\appendixtocname{Appendixes}
\makeatletter
% Inside \appendices, rename "table x. and "figure x." to "appendix x.". Roman numerals
\g@addto@macro\appendices{\renewcommand{\figurename}{Appendix}}
\g@addto@macro\appendices{\renewcommand{\thefigure}{\Roman{figure}}\setcounter{figure}{0}}
\g@addto@macro\appendices{\renewcommand{\tablename}{Appendix}}
\g@addto@macro\appendices{\renewcommand{\thetable}{\Roman{table}}\setcounter{table}{0}}
% Rename sections to use Roman numerals
\g@addto@macro\appendices{\renewcommand{\thesection}{\Roman{section}}}
% Enable uniform numbering for tables and figures inside \appendices, both now called "appendix"
\newcommand*{\dupcntr}[2]{%
\expandafter\let\csname c@#1\expandafter\endcsname\csname c@#2\endcsname
}
\g@addto@macro\appendices{\dupcntr{table}{figure}}
\makeatother
% this creates a section that is invisible in the document proper, but creates a section for the table of contents. Used in appendices
\newcommand\invisiblesection[1]{%
\refstepcounter{section}%
%\addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
\sectionmark{#1}
}
% define \code{}: StackExchange style inline code ----------------------
\usepackage{soul} % typesetting with colour, supports linebreak (\colorbox on its own does not)
\usepackage[table]{xcolor} % use in horizontal lines in tables
% \ctext colorbox height
\makeatletter
\def\SOUL@hlpreamble{%
\setul{}{3.33ex}% default is 2.5ex
\let\SOUL@stcolor\SOUL@hlcolor
\SOUL@stpreamble
}
\makeatother
% make note of thinspaces, enable thin whitespace inside \ctext colorbox
\newcommand{\ctext}[3][RGB]{% Define \ctext
\begingroup
\definecolor{hlcolor}{#1}{#2}\sethlcolor{hlcolor}%
\hl{\thinspace #3\thinspace}%
\endgroup
}
\newcommand{\code}[1]{\texttt{\ctext[RGB]{242,242,242}{#1}}} % define \code command
% link settings --------------------------------------------------------
\usepackage{xurl} % xurl linebreaks long links
\usepackage[hidelinks,breaklinks=true]{hyperref}% Hyperlinks settings. Without hidelinks coloured boxes are drawn around all links (not good)
\def\UrlBreaks{\do\/\do-\do:\do.} % define hyperlinks urlbreaks at "/", "-", ":" and "."
\usepackage[acronym,style=super4col]{glossaries}% Glossaries and lists of acronyms
% Abbreviations --------------------------------------------------------
% Note the definition of plural forms where applicable
\newacronym{anova}{ANOVA}{Analysis of Variance test}
\newacronym{gis}{GIS}{Geographic Information System}
\newacronym[plural=IDEs,firstplural=Integrated development environments (IDE)]{ide}{IDE}{Integrated Development Environment}
\newacronym{ppgis}{PPGIS}{Public Participation Geographic Information System}
\makeglossaries
% Datetime settings ------------------------------------------------------
\usepackage[ddmmyyyy]{datetime} % Change the format of datetime
\newdateformat{mydate}{%
{\THEDAY}.{\THEMONTH}.\THEYEAR}
\newdateformat{monthyeardate}{%
\monthname[\THEMONTH] \THEYEAR} % mm/yyyy date format for English abstract
\newcommand*{\printfindate}{% % Get Finnish months and year for the Finnish abstract
\ifcase \month\or Tammikuu\or Helmikuu\or Maaliskuu\or Huhtikuu\or Toukokuu\or Kesäkuu\or Heinäkuu\or Elokuu\or Syyskuu\or Lokakuu\or Marraskuu\or Joulukuu\fi \space \number\year}
% Images related packages and settings ------------------------------------
\usepackage{rotating, graphicx}
\graphicspath{ {images/} }
% References and reference styles -----------------------------------------
\usepackage{natbib} % Flexible bibliography support
\bibliographystyle{apalike2} % Bibliography style
\setcitestyle{authoryear,open={},close={}} % Removes citation parentheses
\renewcommand*\&{and} % Change all citation ampersands with and's
% Define new command \fullref to reference both section number and name
\newcommand*{\fullref}[1]{\hyperref[{#1}]{\autoref*{#1}, \nameref*{#1}}}
% Define \citeintext to get citeauthor and citeyear in the same command
\newcommand*{\citeintext}[1]{\citeauthor{#1} (\citeyear{#1})}
% Other packages ----------------------------------------------------------
\usepackage{amsmath} % AMS mathematical facilities, equations
\usepackage{subfig} % Enable collections of subfigures as a single figure
\usepackage{gensymb} % Generic symbols for both text and math mode
\usepackage{float} % Improved interface for floating objects
\usepackage{pdfpages} % Include PDF documents in LaTeX
\usepackage{listings} % Typeset source code listings using LaTeX
\usepackage{import} % Establish input relative to a directory
\usepackage{xfp} % Math processing such as \fpeval
% Calculate increase in percentage. #1 new number, #2 original number
\newcommand\calcin[2]{\FPeval\result{round(((#1 - #2) / #2) * 100, 1)}\result~\%}
% Tables -----------------------------------------------------------------
\usepackage{array} % For table properties such as p{2cm}
\usepackage{tabularx} % Tabulars with adjustable-width columns
\usepackage{makecell} % Thicker vline
\usepackage{chngpage} % Allows for temporary adjustment of side margins
\usepackage{longtable} % Allows tables to span multiple pages
\usepackage{cellspace} % Ensure minimal spacing of table cells
\usepackage{booktabs} % Extra commands for tables
\usepackage{multirow} % Enable table cells which can span multiple rows
\usepackage{colortbl} % set custom colors for midrules
\usepackage{tablefootnote} % footnotes in tabular environment
\setlength{\cellspacetoplimit}{6pt}
\setlength{\cellspacebottomlimit}{6pt}
\addparagraphcolumntypes{X}
\newcolumntype{?}{!{\vrule width 1.5pt}} % thicker vline for tabularx
\newcommand\Tstrut{\rule{0pt}{2.2ex}} % Define "top" strut
\newcommand\Bstrut{\rule[-4.0ex]{0pt}{0pt}} % Define "bottom" strut
\newcommand{\TBstrut}{\Tstrut\Bstrut} % Run top & bottom struts for rows
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
% \usepackage[table]{xcolor} and \usepackage{booktabs} to define a lighter midrule
\newcommand{\greyrule}{\arrayrulecolor{black!30}\midrule\arrayrulecolor{black}}
% Define extra wide column separators "C" (centering) and "L" (left-align)
\newlength\tbspace
\setlength\tbspace{0.5cm}
\newcolumntype{C}{c<{\hspace{\tbspace}}}%
\newcolumntype{L}{l<{\hspace{\tbspace}}}%
% Translator command setup -----------------------------------------------
% this enables us to use multilanguage strings which works with package babel
\newcommand{\newtranslatorcommand}[3]{%
\newcommand{#1}{%
\iflanguage{english}{#2}{%
\iflanguage{finnish}{#3}{%
}}%
}%
}
% Title page settings -----------------------------------------------------
\usepackage{setspace} % Different line spacing than document default
\newcommand{\myname}{ % This string represents thesis author in the document
Sampo Vesanen%
}
\newcommand{\mysupervisors}{%
Tuuli Toivonen \\
Petteri Muukkonen \\
Henrikki Tenkanen%
}
\newcommand{\addressFirst}{%
PL 64 (Gustaf Hällströmin katu 2)
}
\newcommand{\addressSecond}{%
00014 Helsingin yliopisto%
}
% Abstract page settings --------------------------------------------------
% THESIS MULTILANGUAGE STRINGS
\newtranslatorcommand{\mytitle}{%
Parking private cars and spatial accessibility in Helsinki Capital Region%
}{%
Henkilöautojen pysäköinti ja spatiaalinen saavutettavuus pääkaupunkiseudulla%
}
\newtranslatorcommand{\mysubtitle}{%
Parking time as a part of the total travel time%
}{%
Pysäköintiajat osana kokonaismatka-aikaa%
}
% Choose correct date format for abstract.
% Dates are now frozen for thesis release. Remove the date and restore the corresponding command if needed.
\newtranslatorcommand{\translatedate}{%
October 2020%
%\monthyeardate\today%
}{%
Lokakuu 2020%
%\printfindate%
}
% PAGE COUNT
% I did not have time to figure out an automatic page count for appendices. Should be possible, though.
\newtranslatorcommand{\mypages}{%
\pageref{myLastPage} pages + 19 pages of appendices%
}{%
\pageref{myLastPage} sivua + 19 liitesivua%
}
% UNIVERSITY NAME
\newtranslatorcommand{\myuni}{%
University of Helsinki%
}{%
Helsingin yliopisto%
}
% FACULTY NAME
\newtranslatorcommand{\myfaculty}{%
Faculty of Science%
}{%
Matemaattisluonnontieteellinen tiedekunta%
}
% DEPARTMENT NAME
\newtranslatorcommand{\mydept}{%
Department of Geosciences and Geography%
}{%
Geotieteiden ja maantieteen osasto%
}
% SUBJECT NAME
\newtranslatorcommand{\mysubject}{%
Geography
}{%
Maantiede
}
% SPECIFIC SUBJECT NAME
\newtranslatorcommand{\mySpecSubject}{%
Geoinformatics%
}{%
geoinformatiikka%
}
% THESIS TYPE
\newtranslatorcommand{\mythesis}{%
Master's thesis%
}{%
Pro gradu -tutkielma%
}
% CHOOSE CORRECT ABSTRACT LANGUAGE
\newtranslatorcommand{\myabstract}{%
\import{content/}{abstract_en.tex}%
}{%
\import{content/}{abstract_fi.tex}%
}
% KEYWORDS
\newtranslatorcommand{\mykeywords}{%
accessibility, door-to-door approach, GIS, Helsinki Capital Region, open data, parking search, parking survey, PPGIS, private car, travel time%
}{%
avoin data, GIS, henkilöauto, matka-aika, ovelta-ovelle-menetelmä, PPGIS, pysäköintikysely, pysäköintipaikan etsiminen, pääkaupunkiseutu, saavutettavuus%
}
% LIBRARY TYPE
\newtranslatorcommand{\mylibrary}{%
E-Thesis / Helda%
}{%
E-Thesis / Helda%
}
% OTHER INFO
\newtranslatorcommand{\myotherinfo}{%
-%
}{%
-%
}
\title{\mytitle}
\author{\myname}
\date{11.10.2020} % Date is now frozen. Use \today to get, today.
% BEGIN DOCUMENT PROPER ---------------------------------------------------
\begin{document}
% TITLE PAGE
\import{elements/}{titlepage.tex}
%%% 1ST ABSTRACT PAGE, ENGLISH
\newpage
\import{elements/}{abstract.tex}
%%% 2ND ABSTRACT PAGE, FINNISH
\newpage
\begin{otherlanguage*}{finnish}
\import{elements/}{abstract.tex}
\end{otherlanguage*}
% TABLE OF CONTENTS
\newpage
\selectlanguage{english}
\thispagestyle{empty} % suppress page numbering
\renewcommand*\contentsname{Table of contents} % Set custom name for ToC
\tableofcontents
% LIST OF FIGURES
\newpage
\thispagestyle{empty}
\listoffigures
% LIST OF TABLES
\thispagestyle{empty}
\listoftables
\thispagestyle{empty}
% LIST OF ABBREVIATIONS AND NOMENCLATURE
% NB, nomenclature labels will not line break if parameters nonumberlist and style=alttree are not combined with \glssetwidest.
\newpage
\printglossary[type=\acronymtype,nonumberlist,title=List of abbreviations]
\thispagestyle{empty}
% Acknowledgements
% \section*{} only adds an entry in the navigation bars, not in the table of contents
\newpage
\section*{Acknowledgements}
\thispagestyle{empty}
I would like to thank Harri Lampi, Johannes Nyman, Samuli Pitzén and Panu Vesanen for their invaluable help in various aspects of this thesis.
% INTRODUCTION AND RESEARCH QUESTIONS
\newpage
\setcounter{page}{1} % set page numbering to start from here
\include{content/c1_introduction}
% THEORETICAL BACKGROUND
\newpage
\import{content/}{c2_background.tex}%
% DATA AND METHODS
\newpage
\import{content/}{c3_data.tex}%
% RESULTS
\newpage
\import{content/}{c4_results.tex}%
% DISCUSSION
\newpage
\import{content/}{c5_discussion.tex}%
% REFERENCES
% Connect Mendeley references to Overleaf bib file. A note about Mendeley synchronisation: Mendeley supports a large amount of data fields to describe sources. However, many of these fields are not carried over to Overleaf when synchronising. For this reason, some details had to be added manually to the references. For this reason there is "references.bib" and "references_final.bib" in this project. "references.bib" is the one which is automatically synchronised from Mendeley, and "references_final.bib" is the file actually used in this thesis, with manual additions for 1) URLs for web sources, 2) accessed dates, and 3) DOI addresses where available.
\newpage
\label{myLastPage} % This label defines the last page to be included in page count of the abstract page
\section{References}
\renewcommand{\refname}{} % remove the title "bibliography" from the \bibliography command
\bibliography{references_final.bib}
% APPENDICES
\newpage
\begin{appendices}
% Instruct package "caption" so that figures and tables hereon do not show in list of figures and tables
\captionsetup[figure]{list=no}
\captionsetup[table]{list=no}
\import{content/}{appendices.tex}%
\end{appendices}
\end{document}