Skip to content

\newtheorem* defines an unnumbered theorem instead of leaking - #222

Merged
tannevaled merged 1 commit into
mainfrom
newtheorem-star
Sep 4, 2026
Merged

\newtheorem* defines an unnumbered theorem instead of leaking#222
tannevaled merged 1 commit into
mainfrom
newtheorem-star

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

amsthm's starred form was unhandled. The star stopped readBraceName dead: no name
was read, the environment stayed undefined, and the star and the heading were
left in the input to be typeset. One paper opened on a spurious page of its own
carrying

*theoremTheorem *namedconjectureConjecture

and then set the three bodies of its theorem environment as plain paragraphs.

The fix

The star is read, and a starred \newtheorem defines the same environment with no
counter, no \the<env>, and a heading with no number — \@beginthmnonum, a sibling
of \@begintheorem without its \ #2, so the head reads Theorem. rather than
Theorem .. The optional note (Theorem (Smith).) goes through the same
continuation as a numbered theorem.

Measured

39 uses across 17 of the 200 arXiv papers. Over the 157 with a tectonic
reference:

before after
page error 574 535
exact 23 24
within 1 page 61 66
within 2 pages 96 103
signed bias +36 −19

The largest single move of the current campaign, and it comes from three lines of
argument parsing: the papers were not merely mis-set, they were carrying macro
arguments as body text and losing every theorem statement's structure.

Two tests, both failing on main: the star must not be typeset, the starred
environment must carry no number while its numbered sibling still counts, and the
optional note must survive.

🤖 Generated with Claude Code

amsthm's starred form was unhandled. The star stopped readBraceName dead: no name
was read, the environment stayed undefined, and the star and the heading were left
in the input to be TYPESET. One paper opened on a spurious page of its own carrying

	*theoremTheorem *namedconjectureConjecture

and then set the three bodies of its theorem environment as plain paragraphs.

The star is now read, and a starred \newtheorem defines the same environment with
no counter, no \the<env>, and a heading with no number: \@beginthmnonum, a sibling
of \@BeginTheorem without its "\ #2", so the head reads "Theorem." rather than
"Theorem ." — the optional note ("Theorem (Smith).") goes through the same
continuation as a numbered one.

39 uses across 17 of the 200 arXiv papers. Measured over the 157 with a tectonic
reference: page error 574 → 535, exact 23 → 24, within 1 page 61 → 66, within 2
pages 96 → 103; the signed bias crosses from +36 to −19.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 60d036a into main Sep 4, 2026
18 checks passed
@tannevaled
tannevaled deleted the newtheorem-star branch September 4, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant