-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathchapter_template.qmd
57 lines (48 loc) · 1.32 KB
/
chapter_template.qmd
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
# Chapter title
```{r include=FALSE}
knitr::opts_chunk$set(
echo = FALSE,
message = FALSE,
warning = FALSE,
fig.pos = "H",
out.width = "100%",
dpi = 300
)
knitr::opts_knit$set(root.dir = rprojroot::find_rstudio_root_file())
source(file.path(here::here(), "R/_quarto_helpers.R"))
source(file.path(here::here(), "R/_load_pkgs.R"))
source(file.path(here::here(), "R/_plotting_helpers.R"))
hookaddcap()
```
```{r fig-figure}
#| fig-cap: "A figure"
#| out-width: "95%"
#| include: false
# all figure chunks should be named "fig-{plot-desc}"
shinipsum::random_ggplotly(type = "histogram") %>%
councilR::plotly_layout(
main_title = "Histogram"
)
```
```{r tbl-table}
#| tbl-cap: "A table"
#| out-width: "95%"
#| include: false
shinipsum::random_table(nrow = 5, ncol = 3) %>%
gt() %>%
gt::opt_row_striping() %>%
tab_style(
style = cell_text(weight = "bold"),
locations = cells_column_labels()
) %>%
gt::fmt_markdown() %>%
gt::as_raw_html()
```
<!-- chapter content -->
```{r echo=FALSE}
caption_index <- readRDS(file.path(here::here(), "caption_index.RDS"))
caption_index <- as.character(as.numeric(caption_index) + 1) %>% stringr::str_pad(width = 2, side = "left", pad = "0")
saveCap(paste0("cap-", caption_index))
saveRDS(caption_index, file.path(here::here(), "caption_index.RDS"))
```
{{< pagebreak >}}