ymlthis makes it easy to write YAML front matter for R Markdown and related documents. yml_*()
functions write functions and use_*()
functions let you write the resulting YAML to your clipboard or to .yml
files related to your project.
You can install ymlthis from CRAN with:
Or you can install the development version of ymlthis from GitHub with:
yml()
creates a basic yml
object returns simple YAML with the author and date.
ymlthis supports many YAML arguments, with YAML-generating functions prefixed with yml_*()
:
yml() %>%
yml_author(c("Yihui Xie", "Hadley Wickham"), affiliation = "RStudio") %>%
yml_date(lubridate::today()) %>%
yml_output(
pdf_document(keep_tex = TRUE, includes = includes2(after_body = "footer.tex")),
bookdown::html_document2()
) %>%
yml_latex_opts(biblio_style = "apalike")
#> ---
#> author:
#> - name: Yihui Xie
#> affiliation: RStudio
#> - name: Hadley Wickham
#> affiliation: RStudio
#> date: '2019-10-10'
#> output:
#> pdf_document:
#> keep_tex: true
#> includes:
#> after_body: footer.tex
#> bookdown::html_document2: default
#> biblio-style: apalike
#> ---
ymlthis also includes an add-in that will create YAML for you and put it in a file, such as an .Rmd
file, or on your clipboard.