Skip to content

HELD: a bibliography entry carries \itemsep + \parsep — and the bias it unmasks is +40 - #705

Closed
tannevaled wants to merge 1 commit into
mainfrom
bibliography-is-a-list
Closed

tannevaled wants to merge 1 commit into
mainfrom
bibliography-is-a-list

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Held: correct, measured against the oracle to the hundredth of a point, and it moves the headline bias from −5 to +40. That number is the finding, not the regression.

The rule

article.cls:565-583 builds thebibliography on \list, and the kernel's \@lbibitem and \@bibitem open each entry with \item (latex.ltx:13275, :13279). So every entry after the first gets what \@item adds (latex.ltx:11567) — \itemsep, plus \parsep, because \parskip is \parsep inside a list. Here the entries were separated by a bare \par.

The registers were already right, which is what makes this one missing call the whole defect: \itemsep, \parsep, \topsep, \labelsep and \labelwidth read identical to the reference's from inside both engines — 4pt plus 2 minus 1, 4pt plus 2 minus 1, 8pt plus 2 minus 4, 5pt, 20pt — and \@iteminterspace had been computing the sum for \itemize and \enumerate all along.

Measured against tectonic on two entries, last baseline of one to first of the next:

reference 19.93pt
before 11.96pt — exactly one \baselineskip, a \par and nothing else
after 19.93pt

7.97pt per entry. 142 of the 154 measured papers carry \bibitem once .bbl files are read.

Measurement, and why it is held

n Σ|·| biais exacts
control (main at cbdf67d) 154 273 −5 46
this branch 154 270 +40 44

Σ|·| improves by 3 and the worst deviation in the corpus improves by 4 — 2407.18384 goes −20 → −16, which no other change this week has moved more than 1. 2402.04711 becomes exact. Thirty-five documents move, all longer, Σ on those thirty-five 103 → 100.

And the signed bias goes from −5 to +40.

Those two are not in conflict; together they say something precise. Before this change our bibliographies were short twice over:

  1. no inter-entry space — 7.97pt × entries, fixed here;
  2. a measure ~32pt too wide, so each entry uses fewer lines than the reference's. \def\list#1#2{\@trivlist} throws away the settings block, so \settowidth\labelwidth{\@biblabel{#1}} and \leftmargin\labelwidth \advance\leftmargin\labelsep never run. Measured: our entries start at x=116.91 where the reference starts them at 133.77, and continue at 133.77 where the reference continues at 149.27.

Fixing (1) alone removes about 45 pages of shortfall. The corpus bias was −5. So the rest of the engine is about 40 pages too long, and the bibliography's two shortfalls were hiding it. That is the same pattern that cost four revised verdicts this week (#690, #691, #693, #569): a figure of merit near zero because two errors cancel.

Why it is not merged yet

The headline number this project publishes is the signed bias, and it is −1 on the landing page today. Moving it to +40 by fixing half of a two-part defect would be trading an honest number for a flattering one in the wrong direction — and the honest sequence is to land the measure with it, or at least to know what the +40 is before publishing it.

So: this branch waits for \list to execute its settings block. That is filed separately (#700) and is not a bibliography defect at all — it is every \list in every real class, and LaTeX indents them with \@totalleftmargin and \parshape, neither of which exists in this engine.

Test

Font-independent: the inter-item space is the smallest baseline gap that is not the \baselineskip, so it is the same number in thebibliography and in itemize, and itemize is the control. Mutation: removing the call fails the bibliography half at 20.88pt — the \section* heading's gap, the only non-\baselineskip gap left — and leaves itemize green.

⚠ An earlier attempt at this fixed \thebibliography in latex.go, which turned out to be dead code: gotex -messages shows the definition in force is the real article.cls one, loaded from texmf/. That edit changed nothing and was reverted.

🤖 Generated with Claude Code

article.cls:565-583 builds thebibliography on \list, and the kernel's \@lbibitem and
\@bibitem open each entry with \item (latex.ltx:13275, 13279). So every entry after
the first gets what \@item adds (latex.ltx:11567) — \itemsep, plus \parsep, because
\parskip is \parsep inside a list. Here the entries were separated by a bare \par and
nothing else.

The registers were already right, which is what makes this one missing call the whole
defect: \itemsep, \parsep, \topsep, \labelsep and \labelwidth read IDENTICAL to the
reference's from inside both engines — 4pt plus 2 minus 1, 4pt plus 2 minus 1, 8pt
plus 2 minus 4, 5pt, 20pt — and \@iteminterspace had been computing the sum for
\itemize and \enumerate all along.

Measured against tectonic on two entries, last baseline of one to first of the next:

    reference   19.93pt
    before      11.96pt   (exactly one \baselineskip: a \par and nothing else)
    after       19.93pt

7.97pt per entry. A 40-entry bibliography was more than half a page short; a
100-entry one a page and a half. 142 of the 154 measured papers carry \bibitem once
.bbl files are read — not 44, which is what the census said while it read only
.tex/.cls/.sty.

The test is font-independent: the inter-item space is the smallest baseline gap that
is not the \baselineskip, so it is the same number in thebibliography and in itemize,
and itemize is the control. Mutation: removing the call fails the bibliography half
at 20.88pt — the \section* heading's gap, the only non-baselineskip gap left — and
leaves itemize green.

⚠ TWO THINGS THIS DOES NOT FIX, both found while measuring it:

The ENTRY'S MEASURE. Our entries start at x=116.91 where the reference starts them at
133.77, the text margin itself, and continue at 133.77 where the reference continues
at 149.27. article.cls computes that from \settowidth\labelwidth{\@biblabel{#1}} in
the SETTINGS BLOCK of \list — and our \list is a two-argument stub expanding to
\@trivlist, so the block is thrown away. That is not a bibliography defect at all; it
is every \list in every real class. Filed separately.

The HEADING. \section*{\refname} comes out at 13.95pt where the reference sets it at
14.35pt bold, 1.44pt higher up.

I first "fixed" this in latex.go's own \thebibliography, which turned out to be dead
code: -messages shows the definition in force is the real article.cls one, loaded
from texmf/. The edit changed nothing and was reverted.

Co-Authored-By: Claude Opus 5 <[email protected]>
@tannevaled

Copy link
Copy Markdown
Contributor Author

Superseded by the branch that fixes the measure as well: correcting the spacing alone raised the bias from -5 to +40 while leaving every bibliography line 32pt too wide. The two cannot be measured apart.

@tannevaled tannevaled closed this Nov 6, 2026
tannevaled added a commit that referenced this pull request Nov 6, 2026
…fore the group

ltlists.dtx:552-573 is the whole macro, and the second argument is where the class
puts the list's geometry:

    \def\list#1#2{%
      \ifnum \@listdepth >5\relax \@toodeep \else \global\advance\@listdepth\@ne \fi
      \rightmargin\z@ \listparindent\z@ \itemindent\z@
      \csname @list\romannumeral\the\@listdepth\endcsname
      \def\@itemLabel{#1}\let\makelabel\@mklab \@nmbrlistfalse
      #2\relax
      \@trivlist
      \parskip\parsep \parindent\listparindent
      \advance\linewidth -\rightmargin \advance\linewidth -\leftmargin
      \advance\@totalleftmargin \leftmargin
      \parshape \@ne \@totalleftmargin \linewidth
      \ignorespaces}

A two-argument stub expanding to \@trivlist threw BOTH arguments away. For every
list in every real class the label vanished and so did \leftmargin, \labelwidth,
\usecounter and whatever else the class wrote there. article.cls:568-573 computes a
bibliography's measure in that block.

⚠ \leftskip and \rightskip in place of \parshape, stated rather than hidden: this
engine has neither \parshape nor \@totalleftmargin. For a list, \parshape \@ne
<indent> <width> sets ONE shape for every line, which is what a pair of skips does;
they differ only for a shape that changes line by line, which \list never asks for.
\leftskip is already how \itemize, \enumerate and \description indent here and it is
measurably right — our itemize continuation lands at 157.68 against 158.67.

⛔ AND \endtrivlist HAD \endgroup BEFORE \par, so a list's LAST item was typeset
after its group had closed, under the enclosing \leftskip and \parindent rather than
the list's. latex.ltx ends the paragraph first. This was invisible until \list
started doing its job: with \list a stub no list ever set \leftskip, so the early
\endgroup had nothing to lose. It showed up the same hour, as entry one on the
margin and entry two 16.86pt left of it.

⛔ AND A BIBLIOGRAPHY ENTRY CARRIES \itemsep — \itemsep ALONE, now that \list sets
\parskip to \parsep. \@item adds \itemsep (latex.ltx:11567); the other half of the
gap is \parskip, which the paragraph break between entries carries by itself.
\@iteminterspace adds BOTH, correctly, because \itemize and \enumerate here never go
through \list; using it for \bibitem would overshoot by 4pt an entry. The two
changes cannot be measured apart, which is why they are one branch.

Measured against tectonic on a two-entry bibliography:

                              entry 1    continuation   entry 2    inter-entry gap
    reference                  133.77        149.27      133.77        19.93
    before                     116.91        133.77      116.91        11.96
    \list alone                133.77        150.64      116.91        15.94
    this branch                133.77        150.64      133.77        19.92

The residual 1.37pt on the continuation is \settowidth measuring [9] in a different
face (11.93pt here, 10.56pt there), not a defect.

\@listdepth, \@mklab, \@toodeep and \makelabel were undefined and are added;
\@listi/\@Listi and \@trivlist were already there with the reference's values.

This supersedes the half-fix on bibliography-is-a-list (#705), which raised the
corpus bias from -5 to +40 by correcting the spacing while leaving the measure 32pt
too wide.

Co-Authored-By: Claude Opus 5 <[email protected]>
tannevaled added a commit that referenced this pull request Nov 6, 2026
…fore the group

ltlists.dtx:552-573 is the whole macro, and the second argument is where the class
puts the list's geometry:

    \def\list#1#2{%
      \ifnum \@listdepth >5\relax \@toodeep \else \global\advance\@listdepth\@ne \fi
      \rightmargin\z@ \listparindent\z@ \itemindent\z@
      \csname @list\romannumeral\the\@listdepth\endcsname
      \def\@itemLabel{#1}\let\makelabel\@mklab \@nmbrlistfalse
      #2\relax
      \@trivlist
      \parskip\parsep \parindent\listparindent
      \advance\linewidth -\rightmargin \advance\linewidth -\leftmargin
      \advance\@totalleftmargin \leftmargin
      \parshape \@ne \@totalleftmargin \linewidth
      \ignorespaces}

A two-argument stub expanding to \@trivlist threw BOTH arguments away. For every
list in every real class the label vanished and so did \leftmargin, \labelwidth,
\usecounter and whatever else the class wrote there. article.cls:568-573 computes a
bibliography's measure in that block.

⚠ \leftskip and \rightskip in place of \parshape, stated rather than hidden: this
engine has neither \parshape nor \@totalleftmargin. For a list, \parshape \@ne
<indent> <width> sets ONE shape for every line, which is what a pair of skips does;
they differ only for a shape that changes line by line, which \list never asks for.
\leftskip is already how \itemize, \enumerate and \description indent here and it is
measurably right — our itemize continuation lands at 157.68 against 158.67.

⛔ AND \endtrivlist HAD \endgroup BEFORE \par, so a list's LAST item was typeset
after its group had closed, under the enclosing \leftskip and \parindent rather than
the list's. latex.ltx ends the paragraph first. This was invisible until \list
started doing its job: with \list a stub no list ever set \leftskip, so the early
\endgroup had nothing to lose. It showed up the same hour, as entry one on the
margin and entry two 16.86pt left of it.

⛔ AND A BIBLIOGRAPHY ENTRY CARRIES \itemsep — \itemsep ALONE, now that \list sets
\parskip to \parsep. \@item adds \itemsep (latex.ltx:11567); the other half of the
gap is \parskip, which the paragraph break between entries carries by itself.
\@iteminterspace adds BOTH, correctly, because \itemize and \enumerate here never go
through \list; using it for \bibitem would overshoot by 4pt an entry. The two
changes cannot be measured apart, which is why they are one branch.

Measured against tectonic on a two-entry bibliography:

                              entry 1    continuation   entry 2    inter-entry gap
    reference                  133.77        149.27      133.77        19.93
    before                     116.91        133.77      116.91        11.96
    \list alone                133.77        150.64      116.91        15.94
    this branch                133.77        150.64      133.77        19.92

The residual 1.37pt on the continuation is \settowidth measuring [9] in a different
face (11.93pt here, 10.56pt there), not a defect.

\@listdepth, \@mklab, \@toodeep and \makelabel were undefined and are added;
\@listi/\@Listi and \@trivlist were already there with the reference's values.

This supersedes the half-fix on bibliography-is-a-list (#705), which raised the
corpus bias from -5 to +40 by correcting the spacing while leaving the measure 32pt
too wide.

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