-
Notifications
You must be signed in to change notification settings - Fork 0
/
Thesis.tex
461 lines (402 loc) · 17.5 KB
/
Thesis.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
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
% Unfortunately for the contents to contain the "Parts" lines successfully, hyperref needs to be disabled.
\documentclass[nohyper,nobib,a4,16pt]{tufte-book} %nobib
% There are usefull references heres: https://github.com/lalider/tufte-latex-thesis/blob/master/main.pdf
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% BOOK DATA %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\title[PhD Thesis: infectious disease dynamics modeling towards informed control decisions]{Modeling infectious disease \\ dynamics towards informed \\ public health interventions: \\ applications on \textsc{covid}-19 and cholera}
\date{\today}
\author[Joseph Lemaitre]{Joseph \ Lemaitre}
\publisher{REMOVE THIS TITLE PAGE AND REPLACE WITH OFFICIAL, PLEASE :)}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% PACKAGES %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[utf8]{inputenc}
\usepackage{pdfpages} % Include pdfs directly
\usepackage[ruled,vlined]{algorithm2e} % algorithms
\usepackage{nameref} % named references
\usepackage{url}
\usepackage{ebgaramond} % Font I use, let's go baroque
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths} %exist for math too
\usepackage{booktabs} % For nicely typeset tabular material
\usepackage{tabularx}
\usepackage{units}
\usepackage{xargs} % several argument in functions (needed for cite)
\usepackage[toc,page]{appendix}
%\usepackage{emoji} % I'd love to have emojis, but it doesn't work
%\setemojifont{TwemojiMozilla}
% Set up the spacing using fontspec features
%\renewcommand\allcapsspacing[1]{{\addfontfeature{LetterSpace=15}#1}}
% \renewcommand\smallcapsspacing[1]{{\addfontfeature{LetterSpace=10}#1}}
\renewcommand{\epsilon}{\varepsilon} % because eb garamond doesn't have epsilon
% math stuff:
%\usepackage{amssymb} % does not play well with garamond math
\usepackage{amsbsy}
\usepackage{makecell}
\usepackage{amsmath}
\usepackage{bm}
%\usepackage[multiple]{footmisc} % several footnotes with delimiters --> breaks stuff
% For graphics / images
\usepackage{graphicx}
\setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio}
% https://tex.stackexchange.com/questions/5017/center-column-with-specifying-width-in-table-tabular-enviroment define x for centered p in tabularx
\usepackage{array}
\newcolumntype{x}[1]{>{\centering\arraybackslash\hspace{0pt}}p{#1}}
% margin figure caption header should to be smaller to remove this weird size diperempty:
% adapted from https://tex.stackexchange.com/questions/319345/change-font-size-in-caption-for-selected-figures, should post it there
\usepackage{caption}
\newcommand{\margincaption}[2][1={}]{%
\captionsetup{font=footnotesize}%
\caption[#1]{#2}}
% The fancyvrb package lets us customize the formatting of verbatim
% environment, so a slightly smaller font is used.
\usepackage{fancyvrb}
\fvset{fontsize=\normalsize}
% provide \FloatBarrier and ensure that floats are placed within their section (can remove this option \usepackage[section]{placeins})
\usepackage{placeins}
% lower case label for figure and tables:
\usepackage[tablename=tab., figurename=fig.]{caption}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%% FRONTMATTER %%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% section in table of content
\setcounter{tocdepth}{3}
% pdf bookmarks, that are open to level 2
\usepackage[open,openlevel=2]{bookmark} %open up to level 2 by default
% Numbered chapters
\setcounter{secnumdepth}{0}
%No link in TOC, that breaks tuftebook
\makeatletter
\let\Hy@linktoc\Hy@linktoc@none
\makeatother
% Prints an epigraph and speaker in sans serif, all-caps type.
\newcommand{\openepigraph}[2]{%
%\sffamily\fontsize{14}{16}\selectfont
\begin{fullwidth}
\sffamily\large
\begin{doublespace}
\noindent\allcaps{#1}\\% epigraph
\noindent\allcaps{#2}% author
\end{doublespace}
\end{fullwidth}
}
% Inserts a blank page
\newcommand{\blankpage}{\newpage\hbox{}\thispagestyle{empty}\newpage}
%%%% Kevin Godny's code for title page and contents from https://groups.google.com/forum/#!topic/tufte-latex/ujdzrktC1BQ
\makeatletter
\renewcommand{\maketitlepage}{%
\begingroup%
\setlength{\parindent}{0pt}
{\fontsize{20}{20}\selectfont\textit{\@author}\par}
%\vspace{1.75in}{\fontsize{36}{54}\selectfont\@title\par}
\vspace{1.75in}{\fontsize{30}{44}\selectfont\@title\par}
\vspace{0.5in}{\fontsize{14}{14}\selectfont\textsf{\smallcaps{\@date}}\par}
\vfill{\fontsize{14}{14}\selectfont\text{\@publisher}\par}
\thispagestyle{empty}
\endgroup
}
\makeatother
\titlecontents{part}%
[0pt]% distance from left margin
{\addvspace{0.25\baselineskip}}% above (global formatting of entry)
{\allcaps{Part~\thecontentslabel}\allcaps}% before w/ label (label = ``Part I'')
{\allcaps{Part~\thecontentslabel}\allcaps}% before w/o label
{}% filler and page (leaders and page num)
[\vspace*{0.5\baselineskip}]% after
\titlecontents{chapter}%
[4em]% distance from left margin
{}% above (global formatting of entry)
{\contentslabel{2em}\textit}% before w/ label (label = ``Chapter 1'')
{\hspace{0em}\textit}% before w/o label
{\qquad\thecontentspage}% filler and page (leaders and page num)
[\vspace*{0.5\baselineskip}]% after
%%%% End additional code by Kevin Godby
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%% BIBLIOGRAPHY & CITATION %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage[backend=biber,doi=false,isbn=false,url=false,eprint=false,style=verbose,citestyle=authoryear,maxbibnames=999,maxcitenames=1,citetracker=true,pagetracker=true,uniquename=false]{biblatex}%,firstinits=true, before: authoryear-comp; unique name is false :)
\addbibresource{../ZoteroLibUpdated/ZoteroLibUpdated.bib}
%\addbibresource{references.bib}
% Remove the In: if there is no journal title. But if not in my defined shortcite, it means that the publication type is ill-defined (should be online, or something without journal)
% Thanks to https://tex.stackexchange.com/questions/502657/how-to-remove-in-from-bibliography-if-there-is-no-journal-information
\renewbibmacro*{in:}{%
\iffieldundef{journaltitle}
{}
{\printtext{\bibstring{in}\intitlepunct}}}
% remove it altogher
%\renewbibmacro*{in:}{;}
% a fullcite command described by removing stuff
\DeclareCiteCommand{\fullcite}
{\usebibmacro{prenote}}
{\clearfield{month}\clearfield{day}\clearfield{pages}\clearfield{volume}\clearfield{number}\clearfield{issue}\clearfield{urlyear}\clearfield{urlmonth}\clearfield{url}\clearfield{pagetotal}%\clearfield{title}\clearfield{journaltitle}%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\DeclareCiteCommand{\fullcite}
{\usebibmacro{prenote}}
{%
\printnames[family]{labelname}% \printnames[given-family]{labelname}
\setunit{\addcomma\space}%
\printfield{title}%
\setunit{\addspace}%addedme
\usebibmacro{in:}%addedme
\setunit{\addspace}%addedme
\printfield{journaltitle}%
\setunit{\addspace}%
\printtext[parens]{%
\printfield{year}}}%printdate
{\multicitedelim}
{\usebibmacro{postnote}}
% a fullcite command described by adding stuff
% Thanks https://tex.stackexchange.com/questions/490049/towards-a-concise-fullcite-command (also:https://tex.stackexchange.com/questions/479590/change-journaltitle-to-italics-in-fullcite, https://tex.stackexchange.com/questions/339681/abbreviate-journal-title-in-fullcite-command)
\DeclareCiteCommand{\fullciteshorta}
{\usebibmacro{prenote}}
{%
\printnames[family]{labelname}% \printnames[given-family]{labelname}
\setunit{\addcomma\space}%
%
\printfield{journaltitle}%
\setunit{\addspace}%
\printtext[parens]{%
\printfield{year}}}%printdate
{\multicitedelim}
{\usebibmacro{postnote}}
\newbibmacro{aycite}{%
\defcounter{maxnames}{1}%
\ifnameundef{labelname}
{\printfield{labeltitle}%
\setunit{\printdelim{nonameyeardelim}}}
{\printnames[family]{labelname}%
\setunit{\printdelim{nameyeardelim}}}
\printtext[bibhyperref]{\printlabeldateextra}}
\DeclareCiteCommand{\fullciteshortb}
{\usebibmacro{prenote}}%
{\usebibmacro{citeindex}%
\usebibmacro{aycite}}
{\multicitedelim}
{\usebibmacro{postnote}}
%[][-\value{listtotal}]
% from me: Remove the visited on https://tex.stackexchange.com/questions/400384/how-to-disable-biblatex-showing-visited-on-on-the-references
%\AtEveryBibitem{
% \clearfield{urlyear}
%\clearfield{urlmonth}
%}
% Only year
%\AtEveryBibitem{\clearfield{month}}
%\AtEveryBibitem{}
%\AtEveryCitekey{\clearfield{month}\clearfield{day}\clearfield{pages}\clearfield{volume}\clearfield{number}\clearfield{issue}\clearfield{urlyear}\clearfield{urlmonth}\clearfield{pagetotal}\clearfield{publication}} % Remove day only in fullcite
\renewcommandx{\cite}[3][1={0pt},2={}]{\sidenote[][#1]{\fullcite[#2]{#3}.}}
\newcommandx{\shortcite}[3][1={0pt},2={}]{\sidenote[][#1]{\fullciteshortb[#2]{#3}.}}
% from me: short citation in sideline: https://tex.stackexchange.com/questions/414716/options-for-styling-fullcite
% No space: https://tex.stackexchange.com/questions/25891/fullcite-without-indent-in-biblatex ---> DELETED
%% Define \longfullcite to include all authors (https://tex.stackexchange.com/questions/142148/typeset-one-citation-with-all-authors)
\makeatletter
\DeclareCiteCommand{\longfullcite}
{\usebibmacro{prenote}}
{\usedriver
{\c@maxnames\blx@maxbibnames\relax
\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}
{\multicitedelim}
{\usebibmacro{postnote}}
\makeatother
% Maybe this, but seems overkill: https://tex.stackexchange.com/questions/71526/repeat-the-same-reference-in-footnote-on-different-pages/71566#71566
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%% HEADINGS %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% --> I want titles ittle in Small capitals
\usepackage{titlesec}
%\usepackage{titletoc}
% Display instead of hang makes it on two line: Chapter 1\\blabla
\makeatletter
\titleformat{\chapter}[display]{\huge\scshape}{\@chapapp~\thechapter}{1em}{}%[\vspace{2ex}\titlerule]
\titleformat{\section}{\Large\scshape}{\thesection}{1em}{}
\titleformat{\subsection}{\large\scshape}{\thesubsection}{1em}{}
\titleformat{\paragraph}[runin]{\scshape}{\theparagraph}{}{}
\makeatother
% Table of contents. works well but should not use tocloft with titlesec
\usepackage[titles]{tocloft}
\renewcommand\cftchapfont{\scshape}
\renewcommand\cftsecfont{\scshape}
\renewcommand\cftsubsecfont{\scshape}
\renewcommand{\cftdot}{} %if fot inside, will put dots
%part from Kevin Godby,
\titlecontents{part}%
[0pt]% distance from left margin
{\addvspace{0.25\baselineskip}}% above (global formatting of entry)
{\allcaps{Part~\thecontentslabel}\allcaps}% before w/ label (label = ``Part I'')
{\allcaps{Part~\thecontentslabel}\allcaps}% before w/o label
{}% filler and page (leaders and page num)
[\vspace*{0.5\baselineskip}]% after
% manual list of abbreviation https://tex.stackexchange.com/questions/149708/simple-list-of-abbreviations-manually
\usepackage{calc}
\makeatletter
\newcommand{\tocfill}{\cleaders\hbox{$\m@th \mkern\@dotsep mu . \mkern\@dotsep mu$}\hfill}
\makeatother
\newcommand{\abbrlabel}[1]{\makebox[3cm][l]{#1\ \tocfill}}
\newenvironment{abbreviations}{\begin{list}{}{\renewcommand{\makelabel}{\abbrlabel}%
\setlength{\labelwidth}{3cm}\setlength{\leftmargin}{\labelwidth+\labelsep}%
\setlength{\itemsep}{0pt}}}{\end{list}}
%% This code creates the groups
% -----------------------------------------
\usepackage{etoolbox}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%% FULLFIGURE %%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% as per https://tex.stackexchange.com/questions/57413/change-caption-in-tufte-class-full-page-figure and https://tex.stackexchange.com/questions/229308/combining-tufte-latex-and-threeparttable/229419#229419 I want normal caption for full page figure... To do this: (I could have also used the fixed pull request by
\RequirePackage{etoolbox}
\makeatletter
\newif\if@tufte@margtab\@tufte@margtabfalse
\AtBeginEnvironment{margintable}{\@tufte@margtabtrue}
\AtEndEnvironment{margintable}{\@tufte@margtabfalse}
\newcommand{\classiccaptionstyle}{%
\long\def\@caption##1[##2]##3{%
\par
\addcontentsline{\csname ext@##1\endcsname}{##1}%
{\protect\numberline{\csname the##1\endcsname}{\ignorespaces ##2}}%
\begingroup
\@parboxrestore
\if@minipage
\@setminipage
\fi
\normalsize
\@makecaption{\csname fnum@##1\endcsname}{\ignorespaces ##3}\par
\endgroup}
\long\def\@makecaption##1##2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{\@tufte@caption@font##1: ##2}%
\ifdim \wd\@tempboxa >\hsize
\@tufte@caption@font\if@tufte@margtab\@tufte@caption@justification\fi##1: ##2\par
\else
\global \@minipagefalse
\hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\setcaptionfont{\normalfont} % To have the rigght captio.n size
\let\caption\@tufte@orig@caption%
\let\label\@tufte@orig@label}
\makeatother
\newenvironment{fwfigure}{%
\begin{figure*}[h!]
\classiccaptionstyle
}{\end{figure*}}
\newenvironment{fwtable}{%
\begin{table*}[h!]
\classiccaptionstyle
}{\end{table*}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% MISC %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Prints argument within hanging parentheses (i.e., parentheses that take
% up no horizontal space). Useful in tabular environments.
\newcommand{\hangp}[1]{\makebox[0pt][r]{(}#1\makebox[0pt][l]{)}}
% Prints an asterisk that takes up no horizontal space.
% Useful in tabular environments.
\newcommand{\hangstar}{\makebox[0pt][l]{*}}
% Prints a trailing space in a smart way.
\usepackage{xspace}
\newcommand{\hairsp}{\hspace{1pt}}% hair space
\newcommand{\ie}{\textit{i.\hairsp{}e.}\xspace}
\newcommand{\eg}{\mbox{\textit{e.\hairsp{}g.}}\xspace}
\newcommand{\na}{\quad--}% used in tables for N/A cells
\newcommand{\eqname}[1]{\tag*{#1}} %tag equations by name
% boxes
\usepackage[most]{tcolorbox}
\newtcolorbox{mybox}[1]{
tikznode boxed title,
enhanced,
breakable,
arc=0mm,
interior style={white},
attach boxed title to top center= {yshift=-\tcboxedtitleheight/2},
fonttitle=\bfseries,
colbacktitle=white,coltitle=black,
boxed title style={size=normal,colframe=white,boxrule=0pt},
title={#1}}
%longer pages
\usepackage{geometry}
\geometry{
a4paper,
textheight=690pt,
}
%Hyperref likes to be loaded last
\usepackage{hyperref}
% prevent hyperref from destroying my lettrines https://tex.stackexchange.com/questions/561651/eb-garamond-initials-and-hyperref-package
%\DeclareTextFontCommand{\textin}{\initials}
%\usepackage{lettrine}
%\setcounter{DefaultLines}{5}
%\renewcommand{\LettrineFontHook}{\initials}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% YAML LISTING %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% from https://tex.stackexchange.com/questions/152829/how-can-i-highlight-yaml-code-in-a-pretty-way-with-listings
\usepackage[dvipsnames]{xcolor}
\usepackage{listings}
\newcommand\YAMLcolonstyle{\color{darkgray}\mdseries\small}
\newcommand\YAMLkeystyle{\color{darkgray}\mdseries\ttfamily\small}
\newcommand\YAMLvaluestyle{\color{orange}\mdseries\small}
\makeatletter
% here is a macro expanding to the name of the language
% (handy if you decide to change it further down the road)
\newcommand\language@yaml{yaml}
\expandafter\expandafter\expandafter\lstdefinelanguage
\expandafter{\language@yaml}
{
keywords={true,false,null,y,n},
keywordstyle=\color{darkgray}\bfseries,
basicstyle=\YAMLkeystyle, % assuming a key comes first
sensitive=false,
comment=[l]{\#},
morecomment=[s]{/*}{*/},
commentstyle=\color{purple}\ttfamily,
stringstyle=\YAMLvaluestyle\ttfamily,
moredelim=[l][\color{orange}]{\&},
moredelim=[l][\color{magenta}]{*},
moredelim=**[il][\YAMLcolonstyle{:}\YAMLvaluestyle]{:}, % switch to value style at :
morestring=[b]',
morestring=[b]",
literate = {---}{{\ProcessThreeDashes}}3
{>}{{\textcolor{red}\textgreater}}1
{|}{{\textcolor{red}\textbar}}1
{\ -\ }{{\mdseries\ -\ }}3,
}
% switch to key style at EOL
\lst@AddToHook{EveryLine}{\ifx\lst@language\language@yaml\YAMLkeystyle\fi}
\makeatother
\newcommand\ProcessThreeDashes{\llap{\color{cyan}\mdseries-{-}-}}
%https://tex.stackexchange.com/questions/560991/change-font-color-of-appendices-page-that-appears-with-the-appendix-package
\renewcommand\appendixpagename{\normalfont \Huge \textsc{Appendices}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%% DOC %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\frontmatter
\input{frontmatter}
\begin{fullwidth}
\pdfbookmark[chapter]{\contentsname}{toc}
\tableofcontents
\addcontentsline{toc}{chapter}{List of Figures}\markboth{List of Figures}{}
\listoffigures
\addcontentsline{toc}{chapter}{List of Tables}\markboth{List of Tables}{}
\listoftables
\end{fullwidth}
\mainmatter
\input{introduction}
%%\input{matmet}
\input{cholera} % 1
\input{cholera-rainfall} % 2
\input{cholera-haiti-ocv} % 3
\input{covid-pipeline-reports} % 4
\input{covid-switzerland-npi} % 5
\input{covid-italy-ocp} % 6
\input{conclusions}
%%input{abbreviations}
\backmatter
\begin{appendices}\input{appendices}\end{appendices}
\begin{fullwidth}\addcontentsline{toc}{chapter}{Bibliography}\markboth{Bibliography}{}\printbibliography\end{fullwidth}
\blankpage
\addcontentsline{toc}{chapter}{Curriculum Vitae}\markboth{Curriculum Vitae}{}\includepdf[pages=-, pagecommand={\thispagestyle{empty}}]{academic_jl.pdf}
\end{document}