Skip to content

Commit

Permalink
Add JOSS and JOSE format (#229)
Browse files Browse the repository at this point in the history
  • Loading branch information
noamross authored and yihui committed Sep 13, 2019
1 parent 243e1b8 commit 4f2ded0
Show file tree
Hide file tree
Showing 14 changed files with 1,065 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ Authors@R: c(
person("Petter", "Uvesten", role = c("aut", "cph"), email = "petter.uvesten.7362@student.lu.se"),
person("Elio", "Campitelli", role = c("aut", "cph"), email = "elio.campitelli@cima.fcen.uba.ar", comment = c(ORCID = "0000-0002-7742-9230")),
person("John", "Muschelli", role = c("aut", "cph"), email = "muschellij2@gmail.com", comment = c(ORCID = "0000-0001-6469-1750")),
person("Zhian N.", "Kamvar", role = c("aut", "cph"), email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108"))
person("Zhian N.", "Kamvar", role = c("aut", "cph"), email = "zkamvar@gmail.com", comment = c(ORCID = "0000-0003-1458-7108")),
person("Noam", "Ross", role = c("aut", "cph"), email = "noam.ross@gmail.com", comment = c(ORCID = "0000-0002-2136-0000"))
)
Description: A suite of custom R Markdown formats and templates for
authoring journal articles and conference submissions.
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export(ctex)
export(elsevier_article)
export(frontiers_article)
export(ieee_article)
export(joss_article)
export(jss_article)
export(mdpi_article)
export(mnras_article)
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
rticles 0.11
---------------------------------------------------------------------

- Added the Journal of Open Source Software (and Education) template (@noamross, #229).

- Tweaked the `tf_article` template to avoid using absolute full paths for figures in the "Figures" section (@jooyoungseo, #246).

rticles 0.10
Expand Down
44 changes: 44 additions & 0 deletions R/joss_article.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#' Journal of Open Source Software (JOSS) format.
#'
#' Format for creating a Journal of Open Source Software (JOSS) or Journal of
#' Open Source Education (JOSE) articles. Adapted
#' from \url{/~https://github.com/openjournals/whedon}. As these journals take
#' articles as markdown, this format can be used to generate markdown from
#' R Markdown and to locally preview how the article will appear as PDF.
#'
#' The following variables may be set in YAML metadata to populate fields in the
#' article PDF, but are only necccessary fo local preview:
#' \code{formatted_doi, citation_author, year, volume, issue, page, submitted, published,
#' review_url, repository}, and \code{archive_doi}.
#'
#' @inheritParams rmarkdown::pdf_document
#' @param journal one of "JOSS" or"JOSE"
#' @param keep_md Whether to retain the intermediate markdown and images.
#' Defaults to TRUE.
#' @param latex_engine,... Arguments passed to \code{rmarkdown::pdf_document}
#' @export
joss_article <- function(journal = "JOSS",
keep_md = TRUE,
latex_engine = "xelatex",
...) {

rmarkdown::pandoc_available('2.2', TRUE)

logo_path <- find_resource("joss_article", paste0(journal, "-logo.png"))
journalname <- ifelse(journal == "JOSS",
"Journal of Open Source Software",
"Journal of Open Source Education")

pdf_document_format(
"joss_article",
latex_engine = latex_engine,
citation_package = "none",
keep_md = keep_md,
pandoc_args = c(
"-V", paste0("logo_path=", logo_path),
"-V", paste0("journal_name=", journalname),
"-V", "graphics=true"
),
...)
}

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ The **rticles** package provides a suite of custom [R Markdown](http://rmarkdown

- [JSS](http://www.jstatsoft.org/) articles

- [JOSS](http://joss.theoj.org/) and [JOSE](https://jose.theoj.org/) articles

- [MDPI](http://www.mdpi.com) journal submissions

- [Monthly Notices of the Royal Astronomical Society](https://academic.oup.com/mnras) articles
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 4f2ded0

Please sign in to comment.