Floats
Full-width figures
Use a fenced Div
with the class fullwidth
, e.g.,
::: {.fullwidth}
Any Markdown content or code blocks here.
```{r, echo=FALSE, fig.dim=c(14, 4)}
plot(sunspots)
```
:::
If you add the class fullscroll
to the Div
, the figure will be scrollable,
e.g.,
::: {.fullwidth .fullscroll}
:::
Embedded figures
You can embed any elements (typically figures) that span into the page margin.
Use a fenced Div
with the class embed-left
or embed-right
, e.g.,
::: {.embed-right}
Here is a special figure.
```{r}
plot(cars)
```
:::
If you want to embed a table, that will be okay, too. Really, you can embed anything.
::: {.embed-left}
```{r, echo=FALSE}
knitr::kable(head(mtcars), caption = 'An example dataset.')
```
:::
Now I have generate some text to fill the space on the right: hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer hold my beer.
Text elements
Table of contents
TOC should be automatically generated unless it is disabled via
features: [-toc]
in YAML. To define the TOC title, use the toc-title
field
in YAML.
Section numbers
Sections should be automatically numbered unless Pandoc has already numbered
them,1 or the feature is disabled via features: [-number_sections]
.
Footnotes
Footnotes should be automatically moved to the right margin,2 unless the
feature is disabled via features: [-sidenotes]
.
Sidenotes
Sidenotes can be generated via a div with classes side
and side-left
or
side-right
. You can use either the HTML syntax <div class="side side-left">
or Pandoc’s fenced Div
, e.g.,
This is a sidenote on the right side when the window is wider than 1280px.
::: {.side .side-right}
This is a **sidenote** on the right.
:::
Citations
Use bibliography
or references
in YAML to include the bibliography database,
and use @
to cite items, e.g., @R-base
generates R Core Team (2023).
knitr::write_bib('base', 'packages.bib')
As you can see above, we generated a .bib
database with knitr::write_bib()
.
Citation entries are displayed in the right margin by default like footnotes. To
disable this behavior, set features: [-sidenotes]
in YAML.
R Core Team. 2023. R: A Language and Environment for Statistical Computing. Vienna, Austria: R Foundation for Statistical Computing. https://www.R-project.org/.