Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update springer template #569

Merged
merged 3 commits into from
May 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: rticles
Title: Article Formats for R Markdown
Version: 0.27.2
Version: 0.27.3
Authors@R: c(
person("JJ", "Allaire", , "[email protected]", role = "aut"),
person("Yihui", "Xie", , "[email protected]", role = "aut",
Expand Down
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# rticles (development version)

- Fix `springer_article()` skeleton: It now uses `equal_contribution` in author field (thanks, @nielsbock, #568).
- Updaye `springer_aticle()` template to version 3 (December 2023):
- BREAKING CHANGE: sn-mathphys.bst has been split into Numbered and Author year style namely `sn-mathphys-num.bst` and `sn-mathphys-ay.bst` respectively. Skeleton has been updated.
If you have existing article, you need to use `sn-mathphys-num` or `sn-mathphys-ay` option now, instead of `sn-mathphys`.

# rticles 0.27

Expand Down
15 changes: 9 additions & 6 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -623,24 +623,27 @@ springer_article <- function(..., keep_tex = TRUE, citation_package = "natbib",
# for backward compatibility as we changed the template in
# https://github.com/rstudio/rticles/pull/494
options <- rmarkdown::yaml_front_matter(input)
new_template_msg <- c("If you are rendering an old Rmd, be advise that the template has changed in version '0.25'\n",
" and you should start from a fresh template to get latest resources and new YAML header format.")
new_template_msg <- function(ver) return (c(sprintf("If you are rendering an old Rmd, be advise that the template has changed in version '%s'\n", ver),
" and you should check new template or start from a fresh template to get latest resources and new YAML header format."))
if (is.null(options[["classoptions"]])) {
stop("`springer_article()` now requires the 'classoptions' field in YAML front matter. ",
new_template_msg, call. = FALSE)
new_template_msg("0.25"), call. = FALSE)
} else if ("sn-mathphys" %in% options[["classoptions"]]) {
stop("classoptions `sn-mathphys` detected. `springer_article()` now uses 'sn-mathphys-num' or `sn-mathphys-ay`. ",
new_template_msg("0.28"), call. = FALSE)
}
if (!is.null(options[["biblio-style"]])) {
warning("`springer_article()` now ignores the 'biblio-style' field in YAML front matter. ",
"Reference style for 'natbib' is now set using the 'classoptions' field.\n",
new_template_msg)
new_template_msg("0.25"))
}
if (!is.null(options[["PACS"]])) {
warning("`springer_article()` now ignores the 'PACS' field in YAML front matter to use `pacs.jel` and `pacs.msc`. ",
new_template_msg)
new_template_msg("0.25"))
}
if (!is.null(options[["authors"]][["name"]])) {
stop("`springer_article()` now uses different authors and affiliations fields.\n",
new_template_msg, call. = FALSE)
new_template_msg("0.25"), call. = FALSE)
}
return(invisible(NULL))
}
Expand Down
6 changes: 3 additions & 3 deletions inst/rmarkdown/templates/springer/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Supported options:
# sn-nature: Style for submissions to Nature Portfolio journals
# sn-basic: Basic Springer Nature Reference Style/Chemistry Reference Style
# sn-mathphys: Math and Physical Sciences Reference Style
# sn-mathphys-num: Math and Physical Sciences Reference Style Numbered
# ssn-mathphys-ay: Math and Physical Sciences Reference Style Author-Year
# sn-aps: American Physical Society (APS) Reference Style
# sn-vancouver: Vancouver Reference Style
# sn-apa: APA Reference Style
# sn-chicago: Chicago-based Humanities Reference Style
# default: Default

classoptions:
- sn-basic
# - Numbered # Optional: Use numbered references instead of namedate references (only for sn-nature, sn-basic, sn-vancouver, sn-chicago, sn-mathphys or sn-nature)
# - Numbered # Optional: Use numbered references instead of namedate references (only for sn-nature, sn-basic, sn-vancouver, sn-chicago, or sn-nature)
# - referee # Optional: Use double line spacing
# - lineno # Optional: Add line numbers
# - iicol # Optional: Double column layour
Expand Down
7 changes: 5 additions & 2 deletions inst/rmarkdown/templates/springer/skeleton/sn-aps.bst
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,9 @@ FUNCTION {format.booktitle}
booktitle "booktitle" bibinfo.check
emphasize
}

FUNCTION {format.in.ed.booktitle}
{ format.booktitle duplicate$ empty$ 'skip$
{format.booktitle duplicate$ empty$ 'skip$
{
format.bvolume duplicate$ empty$ 'pop$
{ ", " swap$ * * }
Expand Down Expand Up @@ -1260,11 +1261,13 @@ FUNCTION {incollection}
format.note output
fin.entry
}

FUNCTION {inproceedings}
{ output.bibitem
format.authors "author" output.check
add.comma
crossref missing$
format.btitle "title" output.check
crossref missing$
{ format.in.ed.booktitle "booktitle" output.check
new.sentence
publisher empty$
Expand Down
2 changes: 1 addition & 1 deletion inst/rmarkdown/templates/springer/skeleton/sn-jnl.cls

Large diffs are not rendered by default.

Loading
Loading