Skip to content

Commit 2fa19ce

Browse files
authored
Merge branch 'master' into wellcome-open-res
2 parents be8cde8 + 2e0a3d0 commit 2fa19ce

40 files changed

+11375
-33
lines changed

DESCRIPTION

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rticles
22
Type: Package
33
Title: Article Formats for R Markdown
4-
Version: 0.20.4
4+
Version: 0.20.8
55
Authors@R: c(
66
person("JJ", "Allaire", role = "aut", email = "jj@rstudio.com"),
77
person("Yihui", "Xie", role = c("aut", "cre"), email = "xie@yihui.name", comment = c(ORCID = "0000-0003-0645-5666")),
@@ -46,8 +46,10 @@ Authors@R: c(
4646
person('Jay', 'Hesselberth', role = c('aut', 'ctb'), email = 'jay.hesselberth@gmail.com', comment = c(ORCID = '0000-0002-6299-179X')),
4747
person("Alfredo", "Hernández", role = c("ctb"), email = "aldomann.designs@gmail.com", comment = c(ORCID = "0000-0002-2660-4545")),
4848
person("Stefano", "Coretta", role = c("ctb"), email = "stefano.coretta@gmail.com", comment = c(ORCID = "0000-0001-9627-5532", github = "stefanocoretta")),
49+
person("Callum", "Arnold", role = c("ctb"), email = "cal.rk.arnold@gmail.com", comment = c(github = "arnold-c")),
50+
person("Matthias", "Templ", role = c("ctb"), email = "matthias.templ@gmail.com", comment = c(ORCID = "0000-0002-8638-5276", github = "matthias-da")),
4951
person("Alvaro", "Uzaheta", role = c("ctb"), email = "alvaro.uzaheta@gess.ethz.ch", comment = c(github = "auzaheta")),
50-
person("Callum", "Arnold", role = c("ctb"), email = "cal.rk.arnold@gmail.com", comment = c(github = "arnold-c"))
52+
person("JooYoung", "Seo", role=c("ctb"), email="jseo1005@illinois.edu", comment = c(ORCID = "0000-0002-4064-6012"))
5153
)
5254
Description: A suite of custom R Markdown formats and templates for
5355
authoring journal articles and conference submissions.

NAMESPACE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export(acm_article)
44
export(acs_article)
55
export(aea_article)
66
export(agu_article)
7+
export(ajs_article)
78
export(amq_article)
89
export(ams_article)
910
export(arxiv_article)
@@ -16,9 +17,11 @@ export(ctex)
1617
export(ctex_article)
1718
export(elsevier_article)
1819
export(frontiers_article)
20+
export(glossa_article)
1921
export(ieee_article)
2022
export(ims_article)
2123
export(jasa_article)
24+
export(jedm_article)
2225
export(joss_article)
2326
export(journals)
2427
export(jss_article)

NEWS.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,39 @@
44

55
# rticles 0.21
66

7+
## NEW FORMATS
8+
9+
- New `jedm_article()` for the Journal of Educational Data Mining template (thanks, @jooyoungseo, #251).
10+
11+
- New `ajs_article()` for *Austrian Journal of Statistics* (thanks, @matthias-da, #437).
12+
13+
- New `glossa_article()` for articles of [Glossa: a journal of general linguistics](https://www.glossa-journal.org/) (thanks, @stefanocoretta, #361).
14+
15+
## MAJOR CHANGES
16+
17+
- Since **rticles** 0.15, per requirement with R Journal, `rjournal_article()` uses `knitr::purl()` to produce a R file with the code from the Rmd file. Last version eagerly overwrites any existing R file with the same name as the purled file. From now on, if a `.R` already exists with the name of the output, it won't be overwritten anymore, and not purled file will be outputted. This prevent issue with users maintaining themselves their own R file to accompany the article. A warning is issued to remind of deleting the existing R file is one want to use the purled R file (thanks, @Enchufa2, #433).
18+
19+
- Update Copernicus Publications template to version 6.3 from 2021-07-08 (thanks, @RLumSK, #432).
20+
21+
## MINOR CHANGES
22+
723
- All templates have now the `$highlighting-macros$` variables required for Pandoc highlighting (#435).
824

925
- Template for `tf_article()` gains a `classoption` variable (thanks, @statzhero, #434).
1026

1127
- Add the fenced div with id `#refs` in `frontiers_article()` skeleton to place the reference section in the correct expected place (thanks, @graysonwhite, #423).
1228

29+
- `bioinformatics_article()` now separates `manuscript_type` (e.g., Applications note, Original article) and `subject_section` (e.g. Genome analysis, Phylogenetics) in template and skeleton (thanks, @stephenturner, #415)
30+
31+
## BUG FIXES
32+
1333
- `bioinformatics_article()` has no more trailing comma after last author (thanks, @stephenturner, #413).
1434

15-
- `bioinformatics_article()` now separates `manuscript_type` (e.g., Applications note, Original article) and `subject_section` (e.g. Genome analysis, Phylogenetics) in template and skeleton (thanks, @stephenturner, #415)
35+
- Fix an issue with `elsevier_article()` and table produced by RStudio Visual Editor. The template gains some packages for allowing grid table in Markdown (thanks, @ccamara, #421)
1636

1737
# rticles 0.20
1838

19-
- `lipics_article()` skeleton now sets option `bookdown.theorem.preamble` to FALSE to work with `bookdown::pdf_book()` and avoid conflicst in theorem environment definition. This requires **bookdown** 0.23 or higher (#392).
39+
- `lipics_article()` skeleton now sets option `bookdown.theorem.preamble` to FALSE to work with `bookdown::pdf_book()` and avoid conflicts in theorem environment definition. This requires **bookdown** 0.23 or higher (#392).
2040

2141
- `oup_article()` template now largely compatible to that of `elsevier_article()` (thanks, @dmkaplan2000, #403)
2242

R/article.R

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,19 @@ frontiers_article <- function(..., keep_tex = TRUE) {
176176
pdf_document_format("frontiers", keep_tex = keep_tex, ...)
177177
}
178178

179+
180+
#' @section \code{glossa_article}: Format for creating submissions to Glossa: a
181+
#' journal of general linguistics. Author Guidelines are available on
182+
#' \href{https://www.glossa-journal.org/site/author-guidelines/}{www.glossa-journal.org}.
183+
#' Template is adapted from \url{https://github.com/guidovw/Glossalatex}.
184+
#' @export
185+
#' @rdname article
186+
glossa_article <- function(..., keep_tex = TRUE, latex_engine = "xelatex") {
187+
pdf_document_format(
188+
"glossa", keep_tex = keep_tex, latex_engine = latex_engine, ...
189+
)
190+
}
191+
179192
#' @param journal one of \code{"aoas"}, \code{"aap"}, \code{"aop"}, \code{"aos"}, \code{"sts"} for \code{ims_article}
180193
#' @section \code{ims_article}: Format for creating submissions to the Institute of Mathematical Statistics
181194
#' \href{https://imstat.org/}{IMS} journals and publications. Adapted from
@@ -258,6 +271,18 @@ lipics_article <- function(
258271
)
259272
}
260273

274+
#' @section \code{jedm_article}: Format for creating Journal of Educational
275+
#' Data Mining (JEDM) articles. Adapted from
276+
#' \url{https://jedm.educationaldatamining.org/index.php/JEDM/information/authors}.
277+
#' @export
278+
#' @rdname article
279+
jedm_article <- function(..., keep_tex = TRUE, citation_package = "natbib") {
280+
pdf_document_format("jedm",
281+
keep_tex = keep_tex,
282+
citation_package = citation_package,
283+
...)
284+
}
285+
261286
#' @section \code{mdpi_article}: Format for creating submissions to
262287
#' Multidisciplinary Digital Publishing Institute (MDPI) journals. Adapted
263288
#' from \url{https://www.mdpi.com/authors/latex}.

R/copernicus_article.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#'
1414
#' An number of required and optional manuscript sections, e.g. \code{acknowledgements}, \code{competinginterests}, or \code{authorcontribution}, must be declared using the respective properties of the R Markdown header - see skeleton file.
1515
#'
16-
#' \strong{Version:} Based on \code{copernicus_package.zip} in the version 6.2, 15 January 2021, using \code{copernicus.cls} in version 9.25.
16+
#' \strong{Version:} Based on \code{copernicus_package.zip} in the version 6.3, 8 July 2021, using \code{copernicus.cls} in version 9.32, 7 July 2021.
1717
#'
1818
#' \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.
1919
#'

R/jss_article.R

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,30 @@ jss_article <- function(
5252
set_sweave_hooks(base, c('CodeInput', 'CodeOutput', 'CodeChunk'))
5353
}
5454

55+
#' Austrian Journal of Statistics (AJS) format.
56+
#'
57+
#' Format for creating a Austrian Journal of Statistics (AJS) article. Adapted
58+
#' from \url{https://www.jstatsoft.org/about/submissions}.
59+
#' @inheritParams jss_article
60+
#' @importFrom rmarkdown pandoc_variable_arg
61+
#' @export
62+
ajs_article <- function(
63+
..., keep_tex = TRUE, citation_package = 'natbib',
64+
pandoc_args = NULL
65+
) {
66+
# set documentclass to ajs for this template
67+
pandoc_args <- c(pandoc_args,
68+
rmarkdown::pandoc_variable_arg("documentclass", "ajs")
69+
)
70+
71+
jss_article(...,
72+
keep_tex = keep_tex,
73+
citation_package = citation_package,
74+
pandoc_args = pandoc_args
75+
)
76+
77+
}
78+
5579
# wrap the content in a raw latex block
5680
latex_block <- function(hook) {
5781
force(hook)

R/rjournal_article.R

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,13 @@ rjournal_article <- function(..., keep_tex = TRUE, citation_package = 'natbib')
7777
# purl the Rmd file to R code per requirement
7878
temp_R <- tempfile(fileext = ".R")
7979
output_R <<- knitr::purl(input_file, temp_R, documentation = 1, quiet = TRUE)
80+
# Add magic comment about '"do not edit" (rstudio/rstudio#2082)
81+
xfun::write_utf8(c(
82+
"# Generated by `rjournal_article()` using `knitr::purl()`: do not edit by hand",
83+
sprintf("# Please edit %s to modify this file", input_file),
84+
"",
85+
xfun::read_utf8(output_R)
86+
), output_R)
8087

8188
NULL
8289
}
@@ -91,7 +98,27 @@ rjournal_article <- function(..., keep_tex = TRUE, citation_package = 'natbib')
9198
}
9299

93100
# Copy purl-ed R file with the correct name
94-
file.copy(output_R, xfun::with_ext(filename, "R"), overwrite = TRUE)
101+
dest_file <- xfun::with_ext(filename, "R")
102+
our_file <- TRUE
103+
if (file.exists(dest_file)) {
104+
# we check this file is generated by us
105+
# otherwise we leave it as is and warn
106+
current_r <- xfun::read_utf8(dest_file)
107+
our_file <- grepl("Generated.*rjournal_article.*do not edit by hand", current_r[1])
108+
if (!our_file) {
109+
warning(
110+
sprintf("R file with name '%s' already exists.", dest_file),
111+
"\nIt will not be overwritten by the one generated",
112+
" during rendering using `knitr::purl()`.",
113+
"\nRemove the existing file to obtain the generated one.",
114+
call. = FALSE
115+
)
116+
}
117+
}
118+
if (our_file) {
119+
# we only overwrite if it is our file
120+
file.copy(output_R, xfun::with_ext(filename, "R"), overwrite = TRUE)
121+
}
95122
unlink(output_R)
96123

97124
# post process TEX file
@@ -102,7 +129,7 @@ rjournal_article <- function(..., keep_tex = TRUE, citation_package = 'natbib')
102129
# check bibliography name
103130
bib_filename <- metadata$bibliography
104131
if (length(bib_filename) == 1 &&
105-
xfun::sans_ext(bib_filename) != xfun::sans_ext(filename)) {
132+
xfun::sans_ext(bib_filename) != xfun::sans_ext(filename)) {
106133
msg <- paste0(
107134
"Per R journal requirement, bibliography file and tex file should",
108135
" have the same name. Currently, you have a bib file ", bib_filename,

README.Rmd

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ Currently included templates and their contributors are the following:
4646
| [ACM: Association for Computings Machinery](https://www.acm.org/publications/about-publications) | [\@ramnathv](https://github.com/ramnathv)| [\#8](https://github.com/rstudio/rticles/pull/8) | `acm_article()`|
4747
| [ACS](https://pubs.acs.org) | [\@yufree](https://github.com/yufree)| [\#15](https://github.com/rstudio/rticles/pull/15) | `acs_article()`|
4848
| [AEA: American Economic Association](https://www.aeaweb.org/journals/policies/templates)| [\@sboysel](https://github.com/sboysel)| [\#86](https://github.com/rstudio/rticles/pull/86) | `aea_articles()` |
49-
| [AGU](https://agupubs.onlinelibrary.wiley.com/) | [\@eliocamp](https://github.com/eliocamp)| [\#199](https://github.com/rstudio/rticles/pull/99)| `agu_article()`|
49+
| [AGU](https://agupubs.onlinelibrary.wiley.com/) | [\@eliocamp](https://github.com/eliocamp)| [\#199](https://github.com/rstudio/rticles/pull/199)| `agu_article()`|
50+
| [AJS: Austrian Journal of Statistics](https://www.ajs.or.at |[\@matthias-da](https://github.com/matthias-da)|[\#437](https://github.com/rstudio/rticles/pull/437)| `ajs_article()`|
5051
| [AMS: American Meteorological Society](https://www.ametsoc.org/)| [\@yufree](https://github.com/yufree)| [\#96](https://github.com/rstudio/rticles/pull/96) | `ams_article()`|
5152
| [ASA: American Statistical Association](https://www.amstat.org/)|| [\#111](https://github.com/rstudio/rticles/pull/111) | `asa_article()`|
5253
| [arXiv](https://arxiv.org/) pre-prints based on George Kour's template| [\@alexpghayes](https://github.com)| [\#236](https://github.com/rstudio/rticles/pull/236) | `arxiv_article()`|
@@ -57,9 +58,11 @@ Currently included templates and their contributors are the following:
5758
| [CTeX](https://ctan.org/pkg/ctex) ||| `ctex()` |
5859
| [Elsevier](https://www.elsevier.com)| [\@cboettig](https://github.com/cboettig)| [\#27](https://github.com/rstudio/rticles/pull/27) | `elsevier_article()` |
5960
| [Frontiers](https://www.frontiersin.org/) | [\@muschellij2](https://github.com/muschellij2)| [\#211](https://github.com/rstudio/rticles/pull/211) | `frontiers_article()`|
61+
| [Glossa](https://www.glossa-journal.org) | [\@stefanocoretta](https://github.com/stefanocoretta) | [#361](https://github.com/rstudio/rticles/pull/361) | `glossa_article()` |
6062
| [IEEE Transaction](http://www.ieee.org/publications_standards/publications/authors/author_templates.html) | [\@Emaasit](https://github.com/Emaasit), [\@espinielli](https://github.com/espinielli), [\@nathanweeks](https://github.com/nathanweeks), [\@DunLug](https://github.com/DunLug) | [\#97](https://github.com/rstudio/rticles/pull/97), [\#169](https://github.com/rstudio/rticles/pull/169), [\#227](https://github.com/rstudio/rticles/pull/227), [\#263](https://github.com/rstudio/rticles/pull/263), [\#264](https://github.com/rstudio/rticles/pull/264), [\#265](https://github.com/rstudio/rticles/pull/265) | `ieee_article()` |
6163
| [IMS: Institute of Mathematical Statistics](https://imstat.org/) [AoAS: Annals of Applied Statistics](https://imstat.org/journals-and-publications/annals-of-applied-statistics/) | [\@auzaheta](https://github.com/auzaheta)| [\#372](https://github.com/rstudio/rticles/pull/372) | `ims_article()`|
6264
| [JASA: Journal of the Acoustical Society of America](https://asa.scitation.org/journal/jas) | [\@stefanocoretta](https://github.com/stefanocoretta)| [\#364](https://github.com/rstudio/rticles/pull/364) | `jasa_article()` |
65+
| [Journal of Educational Data Mining](https://jedm.educationaldatamining.org/index.php/JEDM/about/submissions) journal submissions | [\@jooyoungseo](https://github.com/jooyoungseo) | [#251](https://github.com/rstudio/rticles/pull/251) | `jedm_article()` |
6366
| [JOSS: Journal of Open Source Software](https://joss.theoj.org/) [JOSE: Journal of Open Source Education](https://jose.theoj.org/)| [\@noamross](https://github.com/noamross)| [\#229](https://github.com/rstudio/rticles/pull/229) | `joss_article()` |
6467
| [JSS: Journal of Statistical Software](https://www.jstatsoft.org) ||| `jss_article()`|
6568
| [LIPIcs](https://www.dagstuhl.de/en/publications/lipics)| [\@nuest](https://github.com/nuest)| [\#288](https://github.com/rstudio/rticles/pull/288) | `lipics_article()` |

0 commit comments

Comments
 (0)