Repository navigation
compiler: \fnsymbol{footnote} inside \footnote errors (#564) - #572
Merged
Merged
Conversation
) The expansion engine expanded \fnsymbol against its own counter table, which never defines footnote/mpfootnote, so \fnsymbol{footnote} failed with 'No counter defined' + 'Counter too large' even mid-footnote. Pass \fnsymbol through to the parser (host prelude) and resolve it there against footnote/mpfootnote plus the counter table, rendering values 1-9 with the kernel \@fnsymbol symbols; unknown names and out-of-range values keep honest errors. Implementation-Agent: fnsymbol Commit-Executor: fnsymbol
This was referenced Sep 15, 2026
Merged
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.
Fixes #564.
What changed
Root cause:
\fnsymbol{counter}was expanded eagerly byflashtex-tex-expansion's engine against its own counter table, which never definesfootnote/mpfootnote— those live only in the parser. Fix follows the existing\label/\counterwithinpassthrough pattern:expansion.rs:HOST_PRELUDEgains\let\fnsymbol\flashtexundefined, so the engine emits\fnsymbolunchanged instead of expanding it.parser.rs: newfnsymbol_commanddispatch arm resolvesfootnote/mpfootnote/anyCountersentry and typesets values 1-9 via the existing kernel symbol table. Unknown names get an honest "not defined"; out-of-range values get an honest error and print nothing (matches real LaTeX\@ctrerr).supported.rs: movedfnsymbolfromEXPANSION_COMMANDStoTEXT_COMMANDS(engine no longer executes it).Tests
crates/compiler/tests/footnote_counters.rs: two real\footnotes with\fnsymbol{footnote}render ∗ then † with no counter diagnostics; unknown-counter and out-of-range cases stay honest errors.crates/compilersuite independently re-verified fresh, 100% green, includinggenerated_artifacts_are_current.Follow-up (not this PR)
\thefootnotestill reports unsupported;\arabic{footnote}/\value{footnote}hit the same engine-registers gap — same root cause class, separate slices.Implementation-Agent: muse-spark-1.3-contributor
Commit-Executor: muse-spark-1.3-contributor
🤖 Generated with Claude Code