Skip to content
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.10
Version: 0.27.11
Authors@R: c(
person("JJ", "Allaire", , "jj@posit.co", role = "aut"),
person("Yihui", "Xie", , "xie@yihui.name", role = "aut",
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ supported by the `copernicus.cls`, and fix an issue where the section headers we

## MINOR CHANGES

- Patch `WileyNDJ` template used in `sim_article()` to fix an issue with `etex` package not being useful anymore in recent LaTeX distributions (#593).

- Update all templates to work with Pandoc 3.2.1 by adding the definition of new `\pandocbounded` command used by Pandoc's LaTeX writers (see more at https://github.com/jgm/pandoc/releases/tag/3.2.1 and https://github.com/jgm/pandoc/issues/9660) (#571, #576).

# rticles 0.27
Expand Down
2 changes: 1 addition & 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$$endfor$]{WileyNJD-v5}
\documentclass[AMA,Times1COL$for(classoption)$,$classoption$$endfor$]{WileyNJD-v5}

$if(longtable)$
\usepackage{longtable}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 5 additions & 2 deletions inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,11 @@
\ProcessOptions
\LoadClass[twoside,fleqn,onecolumn]{article}%

\usepackage{etex}%
\reserveinserts{28}% included etex package and \reserveinserts{...} to avoid no room for \newinserts, \newcounts or \newskips etc.
\usepackage{etex}
% Modification by as etex is not used anymore in modern LaTeX
\@ifundefined{reserveinserts}{}{%
\reserveinserts{28}%
}
\RequirePackage{graphicx,multicol}%
\RequirePackage{multirow}%
\RequirePackage{cuted}%
Expand Down
7 changes: 3 additions & 4 deletions tests/testit/test-formats.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ test_format <- function(name, output_options = NULL, skip = NULL) {
# work in a temp directory
dir <- tempfile()
dir.create(dir)
oldwd <- setwd(dir)
on.exit(setwd(oldwd), add = TRUE)
withr::local_dir(dir)

# create a draft of the format
testdoc <- paste0(name, "_article", ".Rmd")
Expand All @@ -24,7 +23,7 @@ test_format <- function(name, output_options = NULL, skip = NULL) {
"Rendering the ", name, " format...",
if (!is.null(output_options)) " (with output options)"
)
output_file <- rmarkdown::render(testdoc, output_options = output_options, quiet = TRUE)
output_file <- rmarkdown::render(testdoc, output_options = output_options, quiet = !interactive())
assert(paste(name, "format works"), {
file.exists(output_file)
})
Expand Down Expand Up @@ -77,7 +76,7 @@ test_format("rjournal")
test_format("rsos")
test_format("rss")
test_format("sage")
test_format("sim", skip = TRUE) # sim format currently broken
test_format("sim")
test_format("springer", skip = !rmarkdown::pandoc_available("2.11.4"))
test_format("tf", output_options = list(reference_style = "CAD"))
test_format("tf", output_options = list(reference_style = "APA"))
Expand Down
13 changes: 13 additions & 0 deletions tools/create_wiley_cls_patch.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Save the patch file in tools folder
patch_file <- "tools/wiley-cls-etex-fix.patch"
# Apply the patch using processx
result <- processx::run("git", c("apply", patch_file), error_on_status = FALSE)

if (result$status == 0) {
message("\nPatch applied successfully!")
} else {
message("\nFailed to apply patch:")
message(result$stderr)
message("\nYou can manually apply it with:")
message(" git apply ", patch_file)
}
20 changes: 20 additions & 0 deletions tools/wiley-cls-etex-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls b/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
index 70af769..3e61516 100644
--- a/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
+++ b/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
@@ -352,8 +352,13 @@
\ProcessOptions
\LoadClass[twoside,fleqn,onecolumn]{article}%

-\usepackage{etex}%
-\reserveinserts{28}% included etex package and \reserveinserts{...} to avoid no room for \newinserts, \newcounts or \newskips etc.
+\usepackage{etex}
+%\ Modification by as etex is not used anymore in modern LaTeX
+\makeatletter
+\@ifundefined{reserveinserts}{}{%
+ \reserveinserts{28}%
+}
+\makeatother
\RequirePackage{graphicx,multicol}%
\RequirePackage{multirow}%
\RequirePackage{cuted}%