Skip to content

Commit 1d56a5b

Browse files
committed
tweak frontiers_article
1 parent aaf6775 commit 1d56a5b

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

R/frontiers_article.R

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
#' Frontiers open access journal format.
22
#'
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}.
45
#'
56
#' @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}}
611
#'
712
#' @export
8-
frontiers_article <- function(keep_tex = TRUE,
9-
includes = NULL){
13+
frontiers_article <- function(highlight = "tango",
14+
keep_tex = TRUE) {
15+
1016
template <- system.file("rmarkdown", "templates", "frontiers_article",
1117
"resources", "template.tex",
1218
package = "rticles")
19+
1320
base <- rmarkdown::pdf_document(template = template,
1421
keep_tex = keep_tex,
15-
includes = includes,
16-
highlight = "tango")#,
17-
# pandoc_args = c("--latex-engine=xelatex"))
22+
highlight = highlight)
1823

1924
# Mostly copied from knitr::render_sweave
2025
base$knitr$opts_knit$out.format <- "sweave"
@@ -43,3 +48,7 @@ frontiers_article <- function(keep_tex = TRUE,
4348
base$knitr$knit_hooks$plot <- knitr::hook_plot_tex
4449
base
4550
}
51+
52+
# mark the format as inheriting from pdf_document
53+
attr(frontiers_article, "base_format") <- "pdf_document"
54+
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Frontiers Template
1+
name: Frontiers Journal Article
22
description: >
3-
Template for Frontiers article
3+
Template for Frontiers journal article
44
create_dir: true

0 commit comments

Comments
 (0)