Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 2.61 KB

README.md

File metadata and controls

75 lines (54 loc) · 2.61 KB

AmaRYAML – Amarakon’s YAML

Contents

Description

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.

Templates

There are currently four templates available in this package:

Book Eisvogel
Book Eisvogel
GitHub NorBeam
GitHub NorBeam
Leaflet [1/2] Leaflet [2/2]
Leaflet [1/2] Leaflet [2/2]

GitHub

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.

Installation

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()

Usage

Using AmaRYAML is very easy. There are two main ways to do so:

  1. selecting a template in RStudio using the R Markdown template selector

  2. 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")