# NOTE: Do not use this function interactively, as in the example below.
# Only specify it as custom knit function in an 'R Markdown' file, like so:
# knit: worcs::cite_all
if (rmarkdown::pandoc_available("2.0")){
file_name <- file.path(tempdir(), "citeall.Rmd")
loc <- rmarkdown::draft(file_name,
template = "github_document",
package = "rmarkdown",
create_dir = FALSE,
edit = FALSE)
write(c("", "Optional reference: @reference2020"),
file = file_name, append = TRUE)
cite_all(file_name)
}
Run the code above in your browser using DataLab