Skip to content

Commit b03c7fc

Browse files
committed
code chunks to bash
1 parent 08ffd50 commit b03c7fc

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.github/workflows/quarto_render.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ jobs:
5656

5757
- name: Set up Quarto
5858
uses: quarto-dev/quarto-actions/setup@v2
59+
60+
- name: Setup R
61+
uses: r-lib/actions/setup-r@v2
5962

6063
- name: Render and Publish
6164
uses: quarto-dev/quarto-actions/publish@v2

quarto-eth-phd-thesis.qmd

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ quarto-eth-phd-thesis/
135135

136136
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.
137137

138-
```
138+
```{bash}
139139
#load packages
140140
packs<-c("ggplot2", "knitr", "kableExtra", "ggthemes", "stringr")
141141
@@ -149,7 +149,7 @@ Also in the `.Rprofile` are some functions to streamline uniform styling of figu
149149

150150
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:
151151

152-
```
152+
```{bash}
153153
thesis_tbl <- function(x, escape, ltable = FALSE) {
154154
x %>%
155155
kbl(digits = 3,
@@ -171,7 +171,7 @@ thesis_tbl <- function(x, escape, ltable = FALSE) {
171171

172172
An example of applying this function is included in `chapters/paper-01-qmd`:
173173

174-
```
174+
```{bash}
175175
#| tbl-pos: H
176176
177177
#load csv of allocation parameter summary statistics
@@ -188,7 +188,7 @@ Calibration_summary %>%
188188

189189
For figures the function `theme_publication()` sets a custom `ggplot2` theme:
190190

191-
```
191+
```{bash}
192192
#' theme_publication
193193
#'
194194
#' custom ggplot2 theme to apply to all plots
@@ -235,7 +235,7 @@ theme_thesis <- function(
235235

236236
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()`:
237237

238-
```
238+
```{bash}
239239
thesis_color <- function(...) {
240240
241241
thesis_colors <- c(
@@ -270,7 +270,7 @@ thesis_color <- function(...) {
270270

271271
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:`
272272

273-
```
273+
```{bash}
274274
p <- ggplot(mtcars, aes(x = wt, y = mpg, color = factor(cyl))) +
275275
geom_point(size = 3) +
276276
labs(
@@ -393,7 +393,7 @@ The code for this is included in `chapters/paper-01/paper-01.qmd` and it uses th
393393

394394
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`:
395395

396-
```
396+
```{bash}
397397
#source the script that prepares all the figures
398398
source("chapters/paper-01/paper-01-figs.R")
399399
@@ -408,7 +408,7 @@ I do this because I find that when I have multiple figures with quite lengthy co
408408

409409
`endmatter/references.qmd` places a div to ensure that all references for all chapters are placed in this section:
410410

411-
```
411+
``` {bash}
412412
::: {#refs}
413413
:::
414414
```

0 commit comments

Comments
 (0)