Repository navigation
render-pipeline: footnotes at the column foot (\footins, \footnoterule, splitting, two-column) - #140
Merged
Merged
Conversation
\footnote, \footnotemark and \footnotetext now go through TeX's insertion machinery instead of being set inline in the paragraph: - the mark is \@makefnmark: the number at \sf@size, raised by sup2 of the lmsy font at the current size, \scriptspace inside the box, with \nobreak before it and the space factor kept; - the note is set as \@footnotetext sets it: \footnotesize, the 1.8em \@makefntext mark box, \footnotesep strut, final strut depth, \interfootnotelinepenalty plus club/widow penalties, \columnwidth; - pagebuild::break_pages_inserts charges \skip\footins and each note against the page goal (TeX 1008-1010), splits a note that does not fit at vert_break, holds over what waits (\floatingpenalty after a split), and \@makecol sets \skip\footins, \footnoterule and the notes in the \vbox to\@ColhT (raggedbottom, flushbottom, \newpage and last page). Two-column documents get footnotes per column. Documents without footnotes keep the existing page builder: HW1, HW2 and the other seven real-world fixtures render byte-identical to main. Oracle: 24 fixtures vs pdflatex (MacTeX 2026), generator and expected data committed; 19 are gated and match every word within 0.5bp (worst 0.006bp) and every rule within 0.1bp. Reported, not gated: \thanks and report chapter reset (compiler), minipage footnotes (hook only), a blank line in a note (compiler), math inside a note (body size). 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
This was referenced Sep 13, 2026
Member
|
Merged to main via integration/2026-09-13k (Commander). |
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.
Footnotes in the render pipeline, implemented in its own page builder (
pagebuild.rs,typeset/footnotes.rs).crates/page-builderis used as a reference only, not adopted. Based on main 85ec30c; no vendor edits, no stacking.What it does
\@makefnmark): the number at\sf@size, raised bysup2of the lmsy optical size LaTeX loads (TeX §758), with\scriptspaceinside the box.\nobreakgoes before it and the space factor is kept.\@footnotetext+ article\@makefntext):\footnotesizeat\columnwidth, with the\hb@[email protected]{\hss mark}box;\footnotesephigh, last line at least\dp\strutboxdeep;\interfootnotelinepenaltyplus the club/widow penalties.pagebuild::break_pages_inserts, TeX §1008–1010 and §1018–1021):\insertmigrates after the line holding the mark;\skip\footinsand each note are charged against the page goal, capped by\dimen\footins;vert_break; the remainder is pruned with\splittopskipand opens the next page;\floatingpenaltyholds later notes after a split;\@doclearpage).\@makecol):\vfilfor\newpageor the last page, then\skip\footins,\footnoterule(\kern-3pt, a 0.4pt × .4\columnwidthrule,\kern2.6pt), then the notes;\vskip-\dpand\@textbottom, packed\vbox to\@colht;\footnotemarkand\footnotetextwith optional numbers work.Documents without footnotes keep the existing
break_pages_shortenedpath.Oracle (
tests/footnotes_oracle.rs)24 fixtures against pdflatex (MacTeX 2026). The generator is
tools/footnotes-oracle/generate.py; expected data is committed and cargo never runs TeX. Gates: page count, every word within 0.5bp, every rule within 0.1bp.Gated (19), all exact (worst word deviation 0.006bp, all rules within 0.1bp):
\footnotemark+\footnotetext(with and without an optional number), adjacent marks\newpage, the last pageReported, not gated (5):
10-report-chapter-reset: 632/634 words. The compiler never resets thefootnotecounter at\chapter; it has no\chapterparsing.12-thanks: the compiler strips\thanks.13-minipage: minipage footnotes (see below).14-multipar-note: the compiler closes a\footnoteargument at a blank line, but\@footnotetextis\long. Separate compiler PR follows.15-math-note: math inside a note is set at body size;TexMathMetricsexists only for the class base size.Gates
cargo test --release: all green (page_frame, floats_oracle, tabular_oracle, incremental, …). New pagebuild unit tests cover skip charging, split with remainder, and hold-over after a split.Composability and integration notes
unsupported_block) and not placed;floatpage.rsis untouched. The insertion accounting isInsertStateinpagebuild.rs(goal, skip, split, penalties), sofloatpage::paginatecan charge insertions next to\@colroomthe same way.Context::minipage_notes(blocks, notes, hsize, page)sets a minipage's notes and returnsMinipageNotes: the rule top, the note lines and the added height/depth, measured from the end of the minipage body (\vskip\skip\@mpfootins \footnoterule \unvbox\@mpfootins).Context::notes/note_anchors), keeps them out of the page insertion list, and calls the hook.\thempfootnote) come from the compiler: the mark text isInline::Footnote::number.Compiler asks
\footnote/\footnotetextargument as\long(separate PR).\thanksasInline::Footnoteinside the title/author inlines, with\@fnsymbolnumbers and the counter reset after\maketitle, instead of stripping it. The pipeline already places notes anchored on title lines.footnotecounter at\chapterin report/book.mpfootnotenumbering (alph) inside minipage.🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu