Skip to content

a footnote's layout is \@makefntext, called, not a row built in Go - #680

Merged
tannevaled merged 2 commits into
mainfrom
makefntext-is-a-macro
Nov 3, 2026
Merged

tannevaled merged 2 commits into
mainfrom
makefntext-is-a-macro

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Next on the parity roadmap (#677) after \thefootnote and \footnoterule:
\@makefnmark was named by 57 of the 154 measured papers and verified by hand as
genuinely absent — it appeared in this engine only inside comments.

The defect

queueFootnoteText built the note as a flat row in Go:

label := []tok{chTok('{', catBegin), csTok("footnotesize")}
label = append(label, stringToToks(mark)...)
label = append(label, chTok(' ', catSpace))
body := append(label, text...)

so no class could place the mark. All three base classes right-align it in a box:

\newcommand\@makefntext[1]{%
    \parindent 1em\noindent\hb@xt@1.8em{\hss\@makefnmark}#1}

(article.cls:609-612, report.cls:708, book.cls:714). Every note's text therefore
began one box-width to the left of the reference's, on every document with a
footnote
.

The note is now handed to \@makefntext the way latex.ltx:13198 hands it over, and
the mark reaches it through \@thefnmark and \@makefnmark (latex.ltx:13168,
:13179) — both replaceable by a document.

Measured

A plain article note, box widths read off the assembled page:

boîte de la marque
avant aucune — [345.000 345.000 15.000 4.950 137.998 345.000 4.950 345.000 15.000 345.000 4.950]
après 14.400pt (1.8 × 8pt), contenant la boîte de 4.950pt de la marque

A document asking for \hb@xt@3in gets 216.81pt where it previously got nothing.

The controls

  • Negative control. A class that asks for no box — \renewcommand\@makefntext[1]{\@makefnmark #1} — gets none. Without it the first test would also pass on an engine that built the 1.8em box in Go, which is the same defect under another name.
  • The text is still there. The note is passed braced, and a misread argument does not show up in a box width — it shows up as the note's text vanishing. Asserted on every case.
  • A macro with no parameter. amsart.cls:1303 writes \def\@makefntext{\indent\@makefnmark} with no parameter at all. The brace group is the argument for the three base classes and an ordinary group for amsart, and both read correctly — a failure that would be invisible on every class the other tests exercise.
  • Mutation. With the \@makefntext call disabled, the two geometry tests fail and the negative control still passes.

Corpus A/B

Control a843d02 (main), treatment 6269c7d:

pages  : 154 comparés, 1 a bougé, Σ|·| = 1, biais = +1
rendu  : 154 comparés, 72 DIFFÉRENTS, dont 71 à pagination identique

Against the reference, refclean:

étiquette Σ|·| biais exacts
makefntext-ctl 277 +49 38
makefntext-trt 276 +50 38

The one document that changed pages, 2209.13121, went 36 → 37 against a reference of
42
: deviation −6 → −5, toward the reference. The signed bias rises because that
paper was short, not because anything got worse; Σ|·| falls by the same 1, and with a
single mover there is no net gain hiding a document that went red.

72 of 154 render differently, 71 of them invisible to a page count — the render
channel again measuring what the page count cannot see (#675).

NOT DONE HERE

\@textsuperscript is the identity in this engine (classprims.go:260), so the mark is
set at text size on the baseline where the reference raises it
(\hbox{\@textsuperscript{\normalfont\@thefnmark}}, latex.ltx:13168-13172). That is a
separate divergence, and this change leaves it exactly as it was.

🤖 Generated with Claude Code

tannevaled and others added 2 commits November 3, 2026 10:10
queueFootnoteText put the mark, a space and the text in a flat list, so no class
could place the mark. All three base classes right-align it in a 1.8em box —

    \newcommand\@makefntext[1]{%
        \parindent 1em\noindent\hb@[email protected]{\hss\@makefnmark}#1}

(article.cls:609-612, report.cls:708, book.cls:714) — so every note's text began
one box-width left of the reference's. The note is now handed to \@makefntext the
way latex.ltx:13198 hands it over, and the mark reaches it through \@thefnmark
and \@makefnmark (latex.ltx:13168, :13179), both of which a document may replace.

Measured on a plain article note: no box of 14.400pt existed anywhere on the page
before, one does now; a document asking for \hb@xt@3in gets 216.81pt where it
previously got nothing.

The note is passed BRACED because amsart.cls:1303 writes \def\@makefntext{%
\indent\@makefnmark} with no parameter at all: that group is the argument for the
three base classes and an ordinary group for amsart, and both read correctly.

\@thefnmark is \def'd inside the note's own group rather than globally. The
reference's \protected@xdef is global, but it rewrites it before every note, so
the two cannot be told apart from the output and the local form cannot leak a
mark into what follows.

NOT DONE HERE: \@textsuperscript is the identity in this engine
(classprims.go:260), so the mark is set at text size on the baseline where the
reference raises it. That is a separate divergence, and this change leaves it
exactly as it was.

Co-Authored-By: Claude Opus 5 <[email protected]>
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