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 sim_article to use Wiley NJD V5 #548

Merged
merged 9 commits into from
Nov 2, 2023
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.25.3
Version: 0.25.4
Authors@R: c(
person("JJ", "Allaire", , "[email protected]", role = "aut"),
person("Yihui", "Xie", , "[email protected]", role = "aut",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# rticles (development version)

## MAJOR CHANGES

- Update WileyNDJ template to V5 for `sim_article()`. This implies new resources files and new available options in template (thanks, @henrikibster, #545).

## MINOR CHANGES

- `elsevier_article()` Rmd skeleton is now updated to show different available bibliostyle file (i.e `*.bst` for _natbib_) with `elsearticle` document class. `biblio-style: elsarticle-harv` is set by default to correctly work with the `authoryear` classoption already set (thanks, @pepijn-devries, #545).

- Update `ajs_article()` resources for the template.
Expand Down
11 changes: 7 additions & 4 deletions R/article.R
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,9 @@ sage_article <- function(..., highlight = NULL, citation_package = "natbib") {

#' @section `sim_article`: Format for creating submissions to Statistics in
#' Medicine. Based on the official Statistics in Medicine
#' at `https://onlinelibrary.wiley.com/page/journal/10970258/homepage/la_tex_class_file.htm`.
#' at `https://authorservices.wiley.com/author-resources/Journal-Authors/Prepare/new-journal-design.html`.
#'
#' This format uses xelatex by default as PDF engine to support the specific NJD fonts, per guideline.
#'
#' Possible arguments for the YAML header are:
#' * `title` title of the manuscript
Expand All @@ -565,17 +567,18 @@ sage_article <- function(..., highlight = NULL, citation_package = "natbib") {
#' * `received`, `revised`, `accepted` dates of submission, revision, and acceptance of the manuscript
#' * `abstract` abstract, limited to 250 words
#' * `keywords` up to 6 keywords
#' * `abbreviations`, list of abbreviations and description separated by a comma
#' * `bibliography` BibTeX `.bib` file
#' * `classoption` options of the `WileyNJD-v2` class
#' * `classoption` options of the `WileyNJD` class
#' * `longtable` set to `true` to include the `longtable` package, used by default from `pandoc` to convert markdown to LaTeX code
#' * `header-includes`: custom additions to the header, before the `\begin{document}` statement
#' * `include-after`: for including additional LaTeX code before the `\end{document}` statement
#' @export
#' @rdname article
sim_article <- function(..., highlight = NULL, citation_package = "natbib") {
sim_article <- function(..., highlight = NULL, citation_package = "natbib", latex_engine = "xelatex") {
pdf_document_format(
"sim",
highlight = highlight, citation_package = citation_package, ...
highlight = highlight, citation_package = citation_package, latex_engine = latex_engine, ...
)
}

Expand Down
32 changes: 31 additions & 1 deletion inst/rmarkdown/templates/sim/resources/template.tex
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\documentclass[AMA,STIX1COL,$for(classoption)$$classoption$$sep$,$endfor$]{WileyNJD-v2}
\documentclass[AMA,STIX1COL$for(classoption)$,$classoption$$endfor$]{WileyNJD-v5}

$if(longtable)$
\usepackage{longtable}
Expand Down Expand Up @@ -138,6 +138,20 @@
\accepted{$accepted$}
$endif$

$if(journal)$
\journal{$journal$}
$endif$

$if(volume)$
\volume{$volume$}
$endif$

$if(copyyear)$
\copyyear{$copyyear$}
$endif$

\startpage{$if(startpage)$$startpage$$else$1$endif$}

\raggedbottom

\begin{document}
Expand All @@ -156,6 +170,10 @@
$if(authormark)$
\authormark{$authormark$}
$endif$
$if(runningtitle)$
\titlemark{$runningtitle$}
$endif$


$for(address)$
\address[$address.num$]{$address.org$}
Expand All @@ -177,8 +195,20 @@
\keywords{$keywords$}
$endif$

$if(jnlcitation)$
\jnlcitation{$jnlcitation$}
$endif$

\maketitle

$if(abbreviations)$
\renewcommand\thefootnote{}
\footnotetext{\textbf{Abbreviations:} $for(abbreviations)$$abbreviations$$sep$; $endfor$.}

\renewcommand\thefootnote{\fnsymbol{footnote}}
\setcounter{footnote}{1}
$endif$

$body$

$if(bibliography)$
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading