Skip to content

Commit

Permalink
Correctly pass pandoc_args between format function
Browse files Browse the repository at this point in the history
fixes #564 and fix support of joss_article() for pdf_book() in bookdown
  • Loading branch information
cderv committed Mar 18, 2024
1 parent d224040 commit ee80f38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# rticles (development version)

- `joss_article()` now correctly works as `base_format` for `bookdown::pdf_book()` (thanks, @mlysy, #564).

- `oup_article()` now supports also `acknowledgments` in addition to `acknowledgements` as the original OUP LaTeX template (thanks, @dmkaplan2000, #563).

- Update resources for `copernicus_article()` to version 7.7 from 3 January 2024.
Expand Down
18 changes: 7 additions & 11 deletions R/joss_article.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,21 @@
joss_article <- function(journal = "JOSS",
keep_md = TRUE,
latex_engine = "xelatex",
pandoc_args = NULL,
...) {
rmarkdown::pandoc_available("2.2", TRUE)

logo_path <- find_resource("joss", paste0(journal, "-logo.png"))
journalname <- ifelse(journal == "JOSS",
"Journal of Open Source Software",
"Journal of Open Source Education"
args <- list(
logo_path = find_resource("joss", paste0(journal, "-logo.png")),
journal_name = ifelse(journal == "JOSS", "Journal of Open Source Software", "Journal of Open Source Education"),
graphics = TRUE
)

pdf_document_format(
"joss",
latex_engine = latex_engine,
citation_package = "default",
keep_md = keep_md,
pandoc_args = c(
"-V", paste0("logo_path=", logo_path),
"-V", paste0("journal_name=", journalname),
"-V", "graphics=true"
),
...
)
pandoc_args = c(pandoc_args, list_to_pandoc_variable_args(args)),
...)
}

0 comments on commit ee80f38

Please sign in to comment.