Skip to content

A bare # kept what followed it - #359

Merged
tannevaled merged 1 commit into
mainfrom
meaning-cat-names
Sep 12, 2026
Merged

tannevaled merged 1 commit into
mainfrom
meaning-cat-names

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

A # that is neither doubled nor followed by a parameter number is legal input wherever it is an argument rather than part of a definition. pgf's parser module reads a token's category from the first two words of its \meaning, and needs # itself to ask the question:

\edef\pgfparser@category@vi{\pgfparser@extractmeaning#}

Two defects met on that one line.

scanBody consumed whatever followed a # and stored it as a parameter marker — here the closing }. The body scan then ran past the end of its own group and absorbed the rest of the file into the definition. pgfmoduleparser.code.tex died on its line 528, and with it \usepgfmodule{parser}, \usetikzlibrary{svg.path}, and every document that loads them — including every paper using the oup-authoring-template class, whose ORCID logo is an svg path. TeX reports "Illegal parameter number", backs the token up and keeps the # as a macro-parameter token (tex.web §479).

catName knew four of TeX's nine category names and answered "the character" for the rest — so # compared equal to every ordinary character, which is exactly the comparison that module makes. All nine of print_cmd_chr's names are now written out (tex.web §298):

source ours (before) tectonic
\def\m#1{[\meaning#1]}\m# [the character #] [macro parameter character #]
\def\take#1{[\meaning#1]}\edef\r{\take#} rest of the document eaten [macro parameter character #]
\m$, \m&, \m^, \m_ the character … math shift / alignment tab / superscript / subscript character …

Measured, 154-paper corpus: Σ 298 → 298, glyphs +0. The shape lives in pgf's own sources, which stay behind GOTEX_PGF, so nothing in the corpus moves — this is a correctness fix that removes one of the reasons that gate cannot open.

Found with the runaway trace from #358, which named the loop in one line.

Expected values in both tests are tectonic's, checked side by side.

🤖 Generated with Claude Code

A # that is neither doubled nor followed by a parameter number is legal input
wherever it is an ARGUMENT rather than part of a definition. pgf's parser module
reads a token's category from the first two words of its \meaning, and needs #
itself to ask the question:

    \edef\pgfparser@category@vi{\pgfparser@extractmeaning#}

Two defects met on that line.

scanBody consumed whatever followed a #, whatever it was, and stored it as a
parameter marker. Here that was the closing }: the body scan ran past the end of
its own group and absorbed the rest of the FILE into the definition.
pgfmoduleparser.code.tex died on its line 528, and with it \usepgfmodule{parser},
\usetikzlibrary{svg.path} and every document that loads them — including every
paper using the oup-authoring-template class, whose ORCID logo is an svg path.
TeX reports "Illegal parameter number", BACKS THE TOKEN UP and keeps the # as a
macro-parameter token (tex.web §479).

catName knew four of TeX's category names and answered "the character" for the
rest. The missing ones are load-bearing here: with # reported as "the character"
the module equated it with every ordinary character. All nine of print_cmd_chr's
names are now written out (tex.web §298).

Measured on the 154-paper corpus: Sigma 298 -> 298, glyphs +0 — the shape lives
in pgf's own sources, which are still behind GOTEX_PGF, so nothing in the corpus
moves. The expected values in both tests are tectonic's, checked side by side.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit a57fd39 into main Sep 12, 2026
18 checks passed
@tannevaled
tannevaled deleted the meaning-cat-names branch September 12, 2026 14:39
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