Conversation
The November 2025 update to oup-authoring-template.cls on CTAN (v1.2) removed the \authormark macro definition while still referencing it from the class' own \@@title. Documents using the rticles oup_v1 template fail to compile with "! Undefined control sequence \authormark" because the template emits \authormark{...} for the running head and the class no longer defines it. Add a \providecommand\authormark[1]{} fallback so rendering works whether or not the upstream macro is available.
Replaces the no-op \providecommand fallback with simply removing the
template block that emitted \authormark{...}. \authormark was an
internal macro of oup-authoring-template.cls that was never part of
the class' documented public API, and it was removed in the v1.2
update (17 November 2025).
The documented running-head mechanism in v1.2 is the optional argument
of \title (\title[short]{long}), which the template already uses. This
matches OUP's own example file on CTAN, which no longer references
\authormark either.
Cosmetic side effect on TeX Live <= 2024 (cls v1.1): the even-page
running head changes from "Author et al." to the short title, which
is what OUP's v1.2 docs now prescribe on both pages anyway.
Mirrors the existing pattern in `ams_article()`, `tf_article()`, and the springer-related warning in `R/article.R`: attach a `pre_knit` hook that checks the parsed YAML metadata and emits an immediate warning when the user supplies a field that is no longer wired up. Since the YAML `authormark` key was undocumented but accepted by the oup_v1 Pandoc template before this fix, users who discovered it would otherwise silently lose the value after the upgrade. The warning makes the removal visible. Adds three testthat tests: - warning fires when metadata contains `authormark` - no warning for unrelated metadata - template no longer contains the literal `\authormark` string (guards against re-introduction)
The direct `fmt$pre_knit(...)` unit test verifies the warning logic but not that rmarkdown actually invokes the hook with the parsed YAML metadata. Add a knit-only render (run_pandoc = FALSE) of an Rmd whose YAML sets `authormark`, asserting the warning surfaces — covers the hook-wiring contract regardless of rmarkdown internals. Skips when pandoc <2.10 (the format already requires it).
`oup_article(oup_version = 1)` rejects construction below pandoc 2.10, so the direct pre_knit unit tests can't even build the format object on older runners. Mirrors the existing skip on the render-based test in the same file, and matches the package-wide convention in `tests/testit/test-formats.R` where `oup_v1` is skipped under the same constraint.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rendering
oup_v1(and all R-CMD-check jobs that exercise it) fails on fresh TinyTeX installs:Root cause
The January 3 2026 CTAN release of
oup-authoring-templatev1.2 removed the\authormarkmacro definition (the cls file's internal\lastmodifieddateis2025/11/17, but CI broke when the package was published on CTAN and TinyTeX started auto-installing the new version).\authormarkwas an internal macro of the class, never part of its documented public API. The rticlesoup_v1template still emitted\authormark{...}for the running head, so every render fails on TinyTeX (which auto-installs the latest CTAN version at render time).The documented running-head mechanism in v1.2 is the optional argument of
\title(\title[short]{long}), which the template already uses (\title[$short_title$]{$title$}intemplate.tex:340). That routes through\short@title→\titlemark, never through the path that calls\authormark. OUP's own example file on CTAN no longer references\authormarkeither.A structural diff of v1.1 → v1.2 confirms
\authormarkis the only macro definition removed; ~40 new macros were added (sideways figures/tables, box environments,\figalttext,\wordcount, etc.), none required by our template.Fix
Drop the template block that emitted
\authormark{...}. On TeX Live ≤ 2024 (cls v1.1), the only visible effect is that the even-page running head changes from "Author et al." to the short title — which is what OUP's v1.2 docs now prescribe on both pages anyway.The YAML
authormarkkey was undocumented but accepted by the Pandoc template before this change, so users who discovered it would silently lose the value after the upgrade. Add apre_knithook — mirroring the pattern inams_article(),tf_article(), and the springer warning inR/article.R— that warns at render time when YAML still setsauthormark.Verification
End-to-end local render with the patched template against a freshly auto-installed v1.2 cls produces a valid PDF (no LaTeX errors).
Tests added:
pre_knithook (warns onauthormark, silent on unrelated metadata).run_pandoc = FALSE) covering the rmarkdown→hook wiring end-to-end.\authormarkstring.Fixes #603