-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,065 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
), | ||
...) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Oops, something went wrong.