You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -67,12 +69,14 @@ Open the `quarto-eth-phd-thesis.Rproj` file in RStudio to access the full projec
67
69
From the RStudio console or terminal:
68
70
69
71
```{bash}
72
+
#| eval: false
70
73
quarto render
71
74
```
72
75
73
76
## 🗂️ Project Structure
74
77
75
78
```{bash}
79
+
#| eval: false
76
80
quarto-eth-phd-thesis/
77
81
├── bibliography.bib # BibTeX file for references
78
82
├── _book/ # Output directory for rendered book
@@ -136,6 +140,7 @@ quarto-eth-phd-thesis/
136
140
I use the `.Rprofile` to load R packages rather than specifying packages within individual `.qmd` files or `.R` scripts as the .Rprofile is called prior to rendering each file. Add any additional packages you require here.
@@ -150,6 +155,7 @@ Also in the `.Rprofile` are some functions to streamline uniform styling of figu
150
155
For tables the `thesis_tbl()` function sets options for `knitr::kbl()` and `kableExtra::kable_styling()` to produce booktabs style tables, with center aligned content and bold column titles:
For figures the function `theme_publication()` sets a custom `ggplot2` theme:
190
196
191
197
```{bash}
198
+
#| eval: false
192
199
#' theme_publication
193
200
#'
194
201
#' custom ggplot2 theme to apply to all plots
@@ -236,6 +243,7 @@ theme_thesis <- function(
236
243
In addition the `.Rprofile` contains a series of functions for producing custom continuous and discrete color palettes with the base set of colors specified within the function `thesis_color()`:
These color palettes can be applied using defined `ggplot2::scale_color_*` and `ggplot2::scale_fill_*` methods. An example of applying the `theme_thesis()` and `scale_color_thesis()` functions is provided in `chapters/paper-01/paper-01-figs.R:`
272
280
273
281
```{bash}
282
+
#| eval: false
274
283
p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
275
284
geom_point(size = 3) +
276
285
labs(
@@ -287,7 +296,7 @@ p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
287
296
288
297
The template allows you to add a coverpage using the [`quarto_titlepages`](https://nmfs-opensci.github.io/quarto_titlepages/) extension. The cover page YAML options are set in in `index.qmd`:
289
298
290
-
```yaml
299
+
```{yaml}
291
300
---
292
301
format:
293
302
pdf:
@@ -326,7 +335,7 @@ Here I have set the title and subtitle using the extension options but you could
326
335
327
336
The ETH doctoral regulations stipulate that the thesis must include a translation of the summary or abstract into one of the Swiss national languages (following the English version). I have added a seperate `.qmd` file to include this and YAML key for specifying the translation of summary in `_quarto.yml`:
328
337
329
-
```yaml
338
+
```{yaml}
330
339
---
331
340
summarytitle: Zusammenfassung
332
341
---
@@ -336,7 +345,7 @@ summarytitle: Zusammenfassung
336
345
337
346
To create the standard ETH title page for thesis I have adapted an [existing LaTeX template](https://github.com/tuxu/ethz-thesis/blob/master/frontbackmatter/titlepage.tex) with the relevant lines included in `ETH-thesis-template.cls`. Rather than directly editing the LaTeX I have defined YAML keys in `partials/title.tex` so that the fields can be filled directly in `_quarto.yml`:
338
347
339
-
```yaml
348
+
```{yaml}
340
349
---
341
350
titlepage-title: "Your thesis title"
342
351
titlepage-author: "Jane Doe"
@@ -362,7 +371,7 @@ Which results in the title page being rendered as:
362
371
363
372
In the template I have included typical chapters such as the Introduction, State of the Art, Structure, Synthesis and an example of chapter based on a published paper (`chapters/paper-01-qmd`). Each chapter is a separate `.qmd` file and you can include/exclude them, or add additional chapters, using the `chapters` YAML key in `_quarto.yml`:
364
373
365
-
```yaml
374
+
```{yaml}
366
375
book:
367
376
date: last-modified
368
377
chapters:
@@ -394,6 +403,7 @@ The code for this is included in `chapters/paper-01/paper-01.qmd` and it uses th
394
403
My preferred method of preparing figures for Quarto documents is to produce and save them via dedicated R scripts rather than directly within the `.qmd` files themselves. This R script is then sourced directly at the head of the respective `.qmd` file to ensure the most up to date figures are used and the images are then included for each figure as in `paper-01.qmd`:
395
404
396
405
```{bash}
406
+
#| eval: false
397
407
#source the script that prepares all the figures
398
408
source("chapters/paper-01/paper-01-figs.R")
399
409
@@ -408,7 +418,7 @@ I do this because I find that when I have multiple figures with quite lengthy co
408
418
409
419
`endmatter/references.qmd` places a div to ensure that all references for all chapters are placed in this section:
0 commit comments