#' @title Creates PDF Assignment
#'
#' @description This is a function called in output in the YAML of the driver Rmd file to specify using the LaTeX template.
#'
#' @param toc Logical. Should a table of contents be included? Default is FALSE.
#' @param number_sections Logical. Number sections? Default is FALSE.
#' @param ... Arguments to be passed to \code{rmarkdown::\link[bookdown]{pdf_document2}}
#'
#' @return A modified \code{pdf_document} based on a LaTeX template.
#'
#' @examples
#' \dontrun{output: CHL5202::pdf_assignment}
#'
#' @export
pdf_assignment <- function(toc = FALSE, number_sections = FALSE, ...){
base <- bookdown::pdf_document2(
toc = toc,
number_sections = FALSE,
template = find_resource('assignment', file = 'template.tex'),
citation_package = 'biblatex',
pandoc_args = c('--metadata', 'link-citations=true'),
...
)
base$knitr$opts_chunk$out.width <- "80%"
base$knitr$opts_chunk$fig.align <- "center"
base
}
#' @title Creates Word Assignment
#'
#' @description This is a function called in output in the YAML of the driver Rmd file to specify using the Word DOCX template.
#'
#' @param toc Logical. Should a table of contents be included? Default is FALSE.
#' @param ... Arguments to be passed to \code{rmarkdown::\link[bookdown]{word_document2}}
#'
#' @return A modified \code{word_document} based on a DOCX template.
#'
#' @examples
#' \dontrun{output: CHL5202::word_assignment}
#'
#' @export
word_assignment <- function(toc = FALSE, ...){
base <- bookdown::word_document2(
toc = toc,
reference_docx = find_resource('assignment', file = 'template.docx'),
pandoc_args = c('--metadata', 'link-citations=true',
paste0('--csl=',
find_resource('assignment', 'vancouver.csl'))),
...
)
base$knitr$opts_chunk$out.width <- "80%"
base$knitr$opts_chunk$fig.align <- "center"
base
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.