Repository navigation
compiler: parse a \footnote argument as \long (port of #142 to required_group_bounded) - #259
Merged
Merged
Conversation
This was referenced Sep 14, 2026
latex.ltx defines \@footnotetext with \long: a blank line inside
\footnote{...} or \footnotetext{...} is a paragraph break in the note.
The parser closed the argument at the blank line instead, reported a
missing brace and an unmatched '}', and moved the rest of the note into
the host paragraph.
Found by the render-pipeline footnote oracle (fixture 14-multipar-note).
Ported from PR #142, which merged cleanly but did not compile: it called
`long_required_group`, a thin wrapper `main` no longer has. What that wrapper
wrapped is still there -- `required_group_bounded(command, span, long)` --
and its `long` arm already does exactly what this needs: a paragraph boundary
inside the argument is recorded but does not end it, and an argument that is
never closed at all is still closed at the end of its first paragraph, so a
missing brace cannot swallow the document. Until now nothing passed `true`,
so the flag had no caller; `\footnote`/`\footnotetext` is the first, and the
doc comment that lived on the deleted wrapper moves onto it. Behaviour is
unchanged from #142.
crates/compiler `cargo test --release` on this tree: 471 passed, 0 failed.
The same command on `main` (eea975c) gives 469, so the delta is exactly this
PR's own `tests/footnote_long_argument.rs`.
Rebase-Agent: Claude Opus 5 (engine lane, linux-primary)
Implementation-Agent: Claude Opus 5 (subagent kabir-claude footnotes render, mac-m5pro-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar
force-pushed
the
rebase/142-footnote-long-argument
branch
from
September 14, 2026 02:22
f99c8a8 to
13da5d9
Compare
GoKubar
added a commit
that referenced
this pull request
Sep 14, 2026
… regions (#343) Closes the second silent-content-loss bug: every \footnote on a page containing a float was dropped. floatpage::paginate now charges the longtable region's reserve alongside the insertion state, so a continuation foot and a note compete for one page as in TeX, and settle_inserts is shared rather than duplicated. Measured end to end: hyperref-toc, lab-report and lmodern-report were silently dropping footnote text on main and now set it; 17 of 23 documents byte-identical. Footnotes oracle 19/24 -> 35/39, float-notes 10/10, tabular still 106/106, amsmath 59/59, HW1/HW2 unchanged. Carries the vendor re-pin, which un-inerts #259, #281, the ~/\nobreakspace fix, text-mode spacing in macro bodies and the amsmath limit operators.
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.
Port of #142 onto current
main. Supersedes #142 — its branch is untouched.#142 merged cleanly but did not compile: it called
long_required_group, a thin wrappermainno longer has. What that wrapper wrapped is still there —required_group_bounded(command, span, long)— and itslongarm already does exactly what the change needs:Until now nothing passed
true, so the flag had no caller.\footnote/\footnotetextis the first, and the doc comment that lived on the deleted wrapper moves onto it. Behaviour is unchanged from #142, so its own two tests pass as written.In latex.ltx
\@footnotetextis\long, so a blank line inside\footnote{...}is a paragraph break in the note. The parser used to close the argument there, report "missing its closing brace" and "unmatched '}'", and move the rest of the note into the host paragraph. Found by the render-pipeline footnote oracle (fixture14-multipar-note).Gates, measured on this tree
main@5e6c65be)crates/compilercargo test --release --no-fail-fastThe delta is exactly this PR's own
tests/footnote_long_argument.rs(a_blank_line_inside_a_footnote_is_a_paragraph_break_in_the_note,an_unclosed_footnote_is_still_closed_at_the_end_of_its_paragraph). No render-pipeline change, so no vendor re-pin is needed for this one on its own.Rebased and re-measured against
main5e6c65be.mainmoved 53 commits during this work, including changes toparser.rs,typeset.rsandmathtex.rs; every number in this PR is from the final tree, not the earlier base.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu