Skip to content

Commit edaaa5d

Browse files
committed
update PR, see comment in #172
1 parent 1278161 commit edaaa5d

File tree

7 files changed

+26
-38
lines changed

7 files changed

+26
-38
lines changed

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ Authors@R: c(
2727
person("Marc-Andre", "Desautels", role = c("aut", "cph"), email = "marc-andre.desautels@cstjean.qc.ca"),
2828
person("Dominik", "Leutnant", role = c("aut", "cph"), email = "leutnant@fh-muenster.de"),
2929
person(family = "MDPI", role = c("aut", "cph")),
30-
person("Oğuzhan", "Öğreden", role = c("aut"), comment = c(ORCID = "0000-0002-9949-3348"),
31-
person("Daniel", "Nüst", role = c("aut", "cph"), email = "daniel.nuest@uni-muenster.de"))
30+
person("Oğuzhan", "Öğreden", role = c("aut"), comment = c(ORCID = "0000-0002-9949-3348")),
31+
person("Daniel", "Nüst", role = c("aut", "cph"), email = "daniel.nuest@uni-muenster.de", comment = c(ORCID = "0000-0002-0024-5046"))
32+
)
3233
Description: A suite of custom R Markdown formats and templates for
3334
authoring journal articles and conference submissions.
3435
License: GPL-3

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ rticles 0.6 (unreleased)
33

44
- Added the template for the SAGE Journals (thanks, @oguzhanogreden, #181).
55

6+
- Added the template for Copernicus Publications journals (thanks, @nuest, #172).
7+
68
rticles 0.5
79
---------------------------------------------------------------------
810

R/copernicus_article.R

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#' @param base_format The function to use for the base format of the article.
88
#' By default, this is \code{rmarkdown::pdf_document}, but to use bookdown's
99
#' cross-referencing feature, this can be set to \code{bookdown::pdf_document2}
10+
#' @param journal_name A regular expression to filter the by the journal name, see \code{pattern} in \code{\link[base]{grep}}; defaults to \code{*}.
1011
#'
1112
#' @return R Markdown output format to pass to
1213
#' \code{\link[rmarkdown:render]{render}}
@@ -18,6 +19,8 @@
1819
#'
1920
#' \strong{Version:} Based on copernicus_package.zip in the version 5.0, 21 March 2018, using \code{copernicus.cls} in version 8.67, 30 January 2018
2021
#'
22+
#' \strong{Copernicus journal abbreviations:} You can use the function \code{copernicus_journal_abbreviations()} to get the journal abbreviation for all journals supported by the copernicus article template.
23+
#'
2124
#' \strong{Important note:} The online guidelines by Copernicus are the official resource.
2225
#' Copernicus is not responsible for the community contributions made to support the template in this package.
2326
#' Copenicus converts all typeset TeX files into XML, the expressions and markups have to be highly standardized.
@@ -41,7 +44,8 @@
4144
#' \url{https://publications.copernicus.org/for_authors/manuscript_preparation.html}
4245
#'
4346
#' @examples
44-
#'
47+
#' names(copernicus_journal_abbreviations())
48+
#' copernicus_journal_abbreviations(journal_name = "Science Data")
4549
#' \dontrun{
4650
#' library("rmarkdown")
4751
#' draft("MyArticle.Rmd", template = "copernicus_article", package = "rticles")
@@ -57,7 +61,7 @@ copernicus_article <- function(...,
5761
"-autolink_bare_uris", # disables automatic links, needed for plain email in \correspondence
5862
"-auto_identifiers" # disables \hypertarget commands
5963
)) {
60-
if (inherits(base_format, "character")) {
64+
if (is.character(base_format)) {
6165
FMT <- eval(parse(text = base_format))
6266
} else {
6367
FMT <- match.fun(base_format)
@@ -112,18 +116,9 @@ copernicus_journals <- list(
112116
"Wind Energy Science" = "wes"
113117
)
114118

115-
#' Copernicus journal abbreviations
116-
#'
117-
#' Get the journal abbreviation for all journals supported by the copernicus article template.
118-
#'
119-
#' @param name A regular expression to filter the by the journal name, see \code{pattern} in \code{\link[base]{grep}}; defaults to \code{*}.
120-
#'
121-
#' @examples
122-
#' names(copernicus_journal_abbreviations())
123-
#' copernicus_journal_abbreviations(name = "Science Data")
124-
#'
119+
#' @rdname copernicus_article
125120
#' @export
126-
copernicus_journal_abbreviations <- function(name = "*") {
127-
journal <- copernicus_journals[grepl(pattern = name, x = names(copernicus_journals), ignore.case = TRUE)]
121+
copernicus_journal_abbreviations <- function(journal_name = "*") {
122+
journal <- copernicus_journals[grepl(pattern = journal_name, x = names(copernicus_journals), ignore.case = TRUE)]
128123
return(unlist(journal))
129124
}

inst/rmarkdown/templates/copernicus_article/skeleton/skeleton.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Template for preparing your manuscript submission to Copernicus journals using RMarkdown
3-
journal: "`r rticles::copernicus_journal_abbreviations(name = 'communication')`"
3+
journal: "`r rticles::copernicus_journal_abbreviations(journal_name = 'communication')`"
44
author:
55
- given_name: Daniel
66
surname: Nüst

man/copernicus_article.Rd

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/copernicus_journal_abbreviations.Rd

Lines changed: 0 additions & 19 deletions
This file was deleted.

tests/testit/test-formats.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ test_format("peerj_article")
4242
test_format("amq_article")
4343
test_format("mdpi_article")
4444
test_format("mnras_article")
45+
test_format("copernicus_article")

0 commit comments

Comments
 (0)