library(knitr) opts_chunk$set(echo = FALSE, cache = TRUE)
R package which includes a suite of custom R Markdown templates. Most of these templates use LaTeX, GitHub is the exception. These templates are useful due to them having common information in the YAML header. They also include global R options that are helpful. I use them so I don't have to define them each time I create a new R Markdown file.
There are currently four templates available in this package:
one = c("") two = c("") templates = data.frame(one, two) kable(templates, 'pipe', align = 'cc', col.name = c("[Book](examples/book/book.pdf)", "[Eisvogel](examples/eisvogel/eisvogel.pdf)"))
one = c("") two = c("") templates = data.frame(one, two) kable(templates, align = 'cc', col.name = c("[GitHub](examples/github/github.md)", "[NorBeam](examples/norbeam/norbeam.pdf)"))
one = c("![Leaflet [1/2]](examples/leaflet/leaflet-1.png)") two = c("![Leaflet [2/2]](examples/leaflet/leaflet-2.png)") templates = data.frame(one, two) kable(templates, align = 'cc', col.name = c("[Leaflet [1/2]](examples/leaflet/leaflet.pdf)", "[Leaflet [2/2]](examples/leaflet/leaflet.pdf)"))
The GitHub template uses a pandoc lua filter script named lower-header.lua
.
This simple script only occupies four lines of code.
Its purpose is to make each section header one level lower.
For example: level one headers (#
) will be turned to level two headers (##
), and so on.
The amaryaml package is currently only available from GitHub. You need the remotes package to install from GitHub:
install.packages("remotes") remotes::install_github("Amarakon55/amaryaml")
This package requires LaTeX for most templates. The tinytex package makes it easy to setup LaTeX within R:
install.packages("tinytex") tinytex::install_tinytex()
Using AmaRYAML is very easy. There are two main ways to do so:
creating a new draft with the rmarkdown::draft()
function
rmarkdown::draft("file.Rmd", "book", "amaryaml")
rmarkdown::draft("file.Rmd", "eisvogel", "amaryaml")
rmarkdown::draft("file.Rmd", "github", "amaryaml")
rmarkdown::draft("file.Rmd", "norbeam", "amaryaml")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.