-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReferencesInRmd.Rmd
More file actions
54 lines (38 loc) · 1.56 KB
/
ReferencesInRmd.Rmd
File metadata and controls
54 lines (38 loc) · 1.56 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
---
title: "References in Rmd"
author: "Ben Anderson"
date: 'Last run at: `r Sys.time()`'
output:
bookdown::html_document2:
keep_md: no
code_folding: hide
collapsed: no
fig_caption: yes
number_sections: yes
toc: yes
toc_float: yes
subtitle: Notes
bibliography: statsCodeRefs.bib
---
# Citations {#citations}
`[@broom]` -> [@broom] <- single ref
`[@broom; @knitr]` -> [@broom; @knitr] <- multiple refs
This form `[-@broom]` [-@broom] drops author name compared to `[@broom]` [@broom] which doesn't.
Get citation styles from [githb](https://github.com/citation-style-language/styles) & install locally?
See also http://citationstyles.org/
# Cross-references
If we use the `bookdown` package [@bookdown] then we can do [cross-references]() to tables, figures and sections.
Table \@ref(tab:tableKnitr) shows something interesting.
> NB: This breaks if you have a range of [non-alphanumeric characters](https://bookdown.org/yihui/rmarkdown/bookdown-markdown.html#cross-referencing) in your chunk labels.
This means we can't use our preferred '.' to seperate chunk label words but there we go...
```{r tableKnitr}
knitr::kable(summary(mtcars), caption = "Table rendered using knitr::kable")
```
Table \@ref(tab:tableKableExtra) shows something interesting with fomrating applied.
```{r tableKableExtra}
library(kableExtra)
kableExtra::kable(summary(mtcars), caption = "Table rendered using kableExtra::kable") %>%
kable_styling()
```
If we want to hop back to a section we need a cross-refence to it e.g. to Section \@ref(citations).
# References