Brent Thorne | 0136eb7 | 2018-11-30 12:50:57 -0500 | [diff] [blame^] | 1 | #' Creates an R Markdown PDF Thesis document |
| 2 | #' |
| 3 | #' This is a function called in output in the YAML of the driver Rmd file |
| 4 | #' to specify using the Brock University LaTeX template and cls files. |
| 5 | #' |
| 6 | #' @export |
| 7 | #' |
| 8 | #' @param toc A Boolean (TRUE or FALSE) specifying where table of contents should be created |
| 9 | #' @param toc_depth A positive integer |
| 10 | #' @param ... arguments to be passed to \code{rmarkdown::\link[rmarkdown]{pdf_document}} |
| 11 | #' |
| 12 | #' @return A modified \code{pdf_document} based on the Jacobs Landscape Poster Latex template |
| 13 | #' @note The arguments highlight, keep_tex, and pandoc_args, are already set. |
| 14 | #' @examples |
| 15 | #' \dontrun{ |
| 16 | #' output: posterdown::poster_pdf |
| 17 | #' } |
| 18 | poster_pdf <- function(toc = TRUE, toc_depth = 3, ...){ |
| 19 | |
| 20 | base <- rmarkdown::pdf_document(template = "template.tex", |
| 21 | toc = toc, |
| 22 | toc_depth = toc_depth, |
| 23 | highlight = "default", |
| 24 | keep_tex = TRUE, |
| 25 | pandoc_args = "--top-level-division=default", |
| 26 | ...) |
| 27 | |
| 28 | # Mostly copied from knitr::render_sweave |
| 29 | base$knitr$opts_chunk$comment <- NA |
| 30 | base$knitr$opts_chunk$fig.align <- "center" |
| 31 | base$knitr$opts_chunk$out.width <- "80%" |
| 32 | base$knitr$opts_knit$root.dir <- getwd() |
| 33 | # Not sure if needed? |
| 34 | base$knitr$knit_hooks$plot <- knitr:::hook_plot_tex |
| 35 | |
| 36 | base |
| 37 | |
| 38 | } |