-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathmain_script.Rmd
More file actions
311 lines (223 loc) · 7.44 KB
/
main_script.Rmd
File metadata and controls
311 lines (223 loc) · 7.44 KB
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
---
output:
bookdown::pdf_book: # comment when rendering to word document
# bookdown::word_document2: # uncomment if rendering to word document
toc: no # change me to yes if rendering to Word
keep_tex: no
number_sections: yes
fig_width: 6
fig_height: 4
latex_engine: xelatex
header-includes:
- \usepackage{ragged2e}
- \usepackage{setspace}
- \usepackage{tocloft}
- \usepackage{float}
- \floatplacement{figure}{H}
- \usepackage{wrapfig}
- \usepackage{pdfpages}
- \usepackage{caption} # allows setting caption width for tables
bibliography: ./References/reference_list.bib
csl: ./References/reference_format-Vancouver.csl
link-citations: yes
linkcolor: black
---
```{r setup, include=FALSE, eval = T}
knitr::opts_chunk$set(echo = TRUE)
options(knitr.duplicate.label = 'allow')
# These libraries are only needed for examples in the introduction
library("png")
library("grid")
# These are needed in case you are having a glossary
library("knitr")
library("kableExtra")
library("dplyr")
library("tibble")
library("readr")
```
<!-- Title page -->
```{r Cover, child = './Sections/00_Cover.Rmd', eval = T}
```
<!-- Set numbers in non Arabic format. And starts in page II as required by G+PS.
NOTE: Remove normal markdown chapters before rendering to PDF -->
\pagenumbering{roman}
\setcounter{page}{2}
<!-- # Committee form -->
```{r Committee_form, child = './Sections/01_Committee_form.Rmd', eval = T}
```
\clearpage
<!-- Global page configuration -->
\setlength{\parindent}{4em}
\linespread{1}
\doublespacing
<!-- # Abstract -->
\section*{Abstract}
\addcontentsline{toc}{section}{Abstract}
```{r Abstract, child = './Sections/02_Abstract.Rmd', eval = T}
```
\clearpage
<!-- # Lay Summary -->
\section*{Lay Summary}
\addcontentsline{toc}{section}{Lay Summary}
```{r Lay_abstract, child = './Sections/03_Lay_abstract.Rmd', eval = T}
```
\clearpage
<!-- # Preface -->
\section*{Preface}
\addcontentsline{toc}{section}{Preface}
```{r Preface, child = './Sections/04_Preface.Rmd', eval = T}
```
\clearpage
<!-- Include a table of contents (including list of figures and tables) without numbering and with dots -->
\phantomsection <!-- This will correct the bookmarks paging (See issue #4) -->
\addcontentsline{toc}{section}{Table of Contents}
\renewcommand*\contentsname{Table of Contents}
\thispagestyle{empty}
\begin{singlespace}
\renewcommand{\cftsecleader}{\cftdotfill{\cftdotsep}}
\setcounter{tocdepth}{3}
\tableofcontents
\clearpage
\phantomsection
\addcontentsline{toc}{section}{List of Tables}
\listoftables
\clearpage
\phantomsection
\addcontentsline{toc}{section}{List of Figures}
\listoffigures
\clearpage
\end{singlespace}
<!-- # Glossary -->
\section*{Glossary}
\addcontentsline{toc}{section}{Glossary}
```{r Glossary, child = './Sections/05_Glossary.Rmd', eval = T}
```
\clearpage
<!-- # Acknowledgements -->
\section*{Acknowledgements}
\addcontentsline{toc}{section}{Acknowledgements}
```{r Acknowledgements, child = './Sections/06_Acknowledgements.Rmd', eval = T}
```
\clearpage
<!-- Dedication -->
\section*{Dedication}
\addcontentsline{toc}{section}{Dedication}
```{r Dedication, child = './Sections/07_Dedication.Rmd', eval = T}
```
\clearpage
# Introduction
<!-- Set Numbering properly for rest of the document -->
\pagenumbering{arabic}
<!-- This code will needs to be before each chapter so figures and tables numbering are according to each chapter -->
<!-- Note that the chapter number changes each time -->
\renewcommand{\thefigure}{1.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{1.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{1.\arabic{equation}}
\setcounter{equation}{0}
```{r Introduction, child = './Sections/08_Introduction.Rmd', eval = T}
```
\clearpage
<!-- From here on, include your different data chapters using normal Rmarkdown titles -->
<!-- Modify me! -->
# Insert Title of Chapter 2 Here
<!-- Set figure and table numbering according to the chapter -->
\renewcommand{\thefigure}{2.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{2.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{2.\arabic{equation}}
\setcounter{equation}{0}
```{r chapter_two, child = 'insert_project_path_here/chapter_manuscript.Rmd', eval = F}
```
\clearpage
<!-- Modify me! -->
# Insert Title of Chapter 3 Here
<!-- Set figure and table numbering according to the chapter -->
\renewcommand{\thefigure}{3.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{3.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{3.\arabic{equation}}
\setcounter{equation}{0}
```{r chapter_three, child = 'insert_project_path_here/chapter_manuscript.Rmd', eval = F}
```
\clearpage
<!-- Modify me! -->
# Insert Title of Chapter 4 Here
<!-- Set figure and table numbering according to the chapter -->
\renewcommand{\thefigure}{4.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{4.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{4.\arabic{equation}}
\setcounter{equation}{0}
```{r chapter_four, child = 'insert_project_path_here/chapter_manuscript.Rmd', eval = F}
```
\clearpage
<!-- Modify me! -->
# Insert Title of Chapter 5 Here
<!-- Set figure and table numbering according to the chapter -->
\renewcommand{\thefigure}{5.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{5.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{5.\arabic{equation}}
\setcounter{equation}{0}
```{r chapter_five, child = 'insert_project_path_here/chapter_manuscript.Rmd', eval = F}
```
\clearpage
<!-- Done with data chapters, last sections -->
# Conclusion
```{r Conclusion, child = './Sections/09_Conclusion.Rmd', eval = T}
```
\clearpage
<!-- # References -->
\section*{Bibliography}
\addcontentsline{toc}{section}{Bibliography}
<!-- Reset page config. For proper referencing -->
\noindent
\leftskip=2em
\parindent=-2em
<div id="refs"></div>
\clearpage
<!-- Go back to original page config. -->
\setlength{\parindent}{4em}
\linespread{1}
\doublespacing
<!-- # Appendices -->
\section*{Appendices}
\addcontentsline{toc}{section}{Appendices}
\setcounter{secnumdepth}{0} <!-- remove numbering for appendices -->
## Appendix A - Supplementary information for Chapter Two
<!-- Set Figure, table and equations numbering according to the chapter -->
\renewcommand{\thefigure}{A2.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{A2.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{A2.\arabic{equation}}
\setcounter{equation}{0}
```{r appendix_a, child = '~/GitHub/FishForVisa/Scripts/supplements.Rmd', eval = F}
```
## Appendix B - Supplementary information for Chapter Three
<!-- Set Figure, table and equations numbering according to the chapter -->
\renewcommand{\thefigure}{A3.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{A3.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{A3.\arabic{equation}}
\setcounter{equation}{0}
```{r appendix_b, child = '~/GitHub/TransEmergence/Scripts/Supplements.Rmd', eval = F}
```
## Appendix C - Supplementary information for Chapter Four
<!-- Set Figure, table and equations numbering according to the chapter -->
\renewcommand{\thefigure}{A4.\arabic{figure}}
\setcounter{figure}{0}
\renewcommand{\thetable}{A4.\arabic{table}}
\setcounter{table}{0}
\renewcommand{\theequation}{A4.\arabic{equation}}
\setcounter{equation}{0}
```{r appendix_c, child = '~/GitHub/OC_Transboundary/Ecol/Supplements.Rmd', eval = F}
```
<!-- END OF SCRIPT -->