|
1 | 1 | #' Frontiers open access journal format.
|
2 | 2 | #'
|
3 |
| -#' Format for creating Frontiers journal articles. Adapted from \href{http://home.frontiersin.org/about/author-guidelines}{http://home.frontiersin.org/about/author-guidelines}. |
| 3 | +#' Format for creating Frontiers journal articles. Adapted from |
| 4 | +#' \href{http://home.frontiersin.org/about/author-guidelines}{http://home.frontiersin.org/about/author-guidelines}. |
4 | 5 | #'
|
5 | 6 | #' @inheritParams rmarkdown::pdf_document
|
| 7 | +#' @param ... Additional arguments to \code{rmarkdown::pdf_document} |
| 8 | +#' |
| 9 | +#' @return R Markdown output format to pass to |
| 10 | +#' \code{\link[rmarkdown:render]{render}} |
6 | 11 | #'
|
7 | 12 | #' @export
|
8 |
| -frontiers_article <- function(keep_tex = TRUE, |
9 |
| - includes = NULL){ |
| 13 | +frontiers_article <- function(highlight = "tango", |
| 14 | + keep_tex = TRUE) { |
| 15 | + |
10 | 16 | template <- system.file("rmarkdown", "templates", "frontiers_article",
|
11 | 17 | "resources", "template.tex",
|
12 | 18 | package = "rticles")
|
| 19 | + |
13 | 20 | base <- rmarkdown::pdf_document(template = template,
|
14 | 21 | keep_tex = keep_tex,
|
15 |
| - includes = includes, |
16 |
| - highlight = "tango")#, |
17 |
| - # pandoc_args = c("--latex-engine=xelatex")) |
| 22 | + highlight = highlight) |
18 | 23 |
|
19 | 24 | # Mostly copied from knitr::render_sweave
|
20 | 25 | base$knitr$opts_knit$out.format <- "sweave"
|
@@ -43,3 +48,7 @@ frontiers_article <- function(keep_tex = TRUE,
|
43 | 48 | base$knitr$knit_hooks$plot <- knitr::hook_plot_tex
|
44 | 49 | base
|
45 | 50 | }
|
| 51 | + |
| 52 | +# mark the format as inheriting from pdf_document |
| 53 | +attr(frontiers_article, "base_format") <- "pdf_document" |
| 54 | + |
0 commit comments