Skip to content

compiler: \fnsymbol{footnote} inside \footnote errors (#564) - #572

Merged
GoKubar merged 1 commit into
mainfrom
agent/daniel-muse-lead-2/fnsymbol
Sep 15, 2026
Merged

GoKubar merged 1 commit into
mainfrom
agent/daniel-muse-lead-2/fnsymbol

Conversation

@d-q222

@d-q222 d-q222 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #564.

What changed

Root cause: \fnsymbol{counter} was expanded eagerly by flashtex-tex-expansion's engine against its own counter table, which never defines footnote/mpfootnote — those live only in the parser. Fix follows the existing \label/\counterwithin passthrough pattern:

  • expansion.rs: HOST_PRELUDE gains \let\fnsymbol\flashtexundefined, so the engine emits \fnsymbol unchanged instead of expanding it.
  • parser.rs: new fnsymbol_command dispatch arm resolves footnote/mpfootnote/any Counters entry 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: moved fnsymbol from EXPANSION_COMMANDS to TEXT_COMMANDS (engine no longer executes it).

Tests

  • New 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.
  • Full crates/compiler suite independently re-verified fresh, 100% green, including generated_artifacts_are_current.

Follow-up (not this PR)

\thefootnote still 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

)

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
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.

compiler: \fnsymbol{footnote} inside \footnote errors

2 participants