Skip to content

Commit 2c81480

Browse files
committed
patch wileyNJD
1 parent 0293ddf commit 2c81480

File tree

3 files changed

+40
-2
lines changed

3 files changed

+40
-2
lines changed

inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,13 @@
352352
\ProcessOptions
353353
\LoadClass[twoside,fleqn,onecolumn]{article}%
354354

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

tools/create_wiley_cls_patch.R

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Save the patch file in tools folder
2+
patch_file <- "tools/wiley-cls-etex-fix.patch"
3+
# Apply the patch using processx
4+
result <- processx::run("git", c("apply", patch_file), error_on_status = FALSE)
5+
6+
if (result$status == 0) {
7+
message("\nPatch applied successfully!")
8+
} else {
9+
message("\nFailed to apply patch:")
10+
message(result$stderr)
11+
message("\nYou can manually apply it with:")
12+
message(" git apply ", patch_file)
13+
}

tools/wiley-cls-etex-fix.patch

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls b/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
2+
index 70af769..3e61516 100644
3+
--- a/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
4+
+++ b/inst/rmarkdown/templates/sim/skeleton/WileyNJD-v5.cls
5+
@@ -352,8 +352,13 @@
6+
\ProcessOptions
7+
\LoadClass[twoside,fleqn,onecolumn]{article}%
8+
9+
-\usepackage{etex}%
10+
-\reserveinserts{28}% included etex package and \reserveinserts{...} to avoid no room for \newinserts, \newcounts or \newskips etc.
11+
+\usepackage{etex}
12+
+%\ Modification by as etex is not used anymore in modern LaTeX
13+
+\makeatletter
14+
+\@ifundefined{reserveinserts}{}{%
15+
+ \reserveinserts{28}%
16+
+}
17+
+\makeatother
18+
\RequirePackage{graphicx,multicol}%
19+
\RequirePackage{multirow}%
20+
\RequirePackage{cuted}%

0 commit comments

Comments
 (0)