Repository navigation
Description
Measured against tectonic
\documentclass{article}
\usepackage[authoryear]{natbib}
\begin{document}
Texte \citep{alpha} et \citet{alpha} fin.
\begin{thebibliography}{}
\bibitem[Author et~al.(2021)Author, Bee, and Cee]{alpha} Author, A., Bee, B., and Cee, C. (2021). Un titre. Revue, 1(2):3--4.
\end{thebibliography}
\end{document}| this engine | tectonic |
|
|---|---|---|
\citep{alpha} |
[1] |
(Author et al., 2021) |
\citet{alpha} |
[1] |
Author et al. (2021) |
| the entry's label | [1] Author, A., … |
Author, A., … — none |
| the line's width | 75.9pt | 237.5pt |
Three defects on one line, and the third is the one that is easy to miss: in author-year mode a \bibitem[⟨label⟩] entry carries no bracketed number at all, and we print one.
Where it comes from
natbib.sty:645-673 (\NAT@set@cites) switches every citation command on \if@NAT@numbers, which the authoryear option clears. bibtex.go:515-525 says so in its own comment — "identical output to \cite in this numeric model" — so this is a known simplification that has never been priced.
And \bibitem's optional argument is discarded: latex.go:353 is
\def\@bibitemopt[#1]#2{\par\@iteminterspace\noindent\advance\c@bibitem by1\relax
\edef\@currentlabel{\thebibitem}\label{#2}\llap{\@biblabel{\thebibitem}\enspace}}
— #1 appears nowhere in the body. That optional argument is the author-year label that plainnat, unsrtnat and apalike emit, so every one of them is thrown away. The comment above that definition (latex.go:332-339) describes reading it, which makes this a place where the prose and the code disagree.
How much of the corpus
population over .tex,.cls,.sty,.bbl for authoryear|citep|citet: 68 of the 154 measured papers.
Scored against the reference on the current main:
| n | Σ|·| | biais | exacts | |
|---|---|---|---|---|
| papers using author-year citations | 68 | 128 | +6 | 16 (24%) |
| the rest | 86 | 145 | −11 | 30 (35%) |
The citation population is a third less likely to paginate exactly. That is consistent with a citation that is three times too narrow on every line it appears in, though it does not prove the causal link on its own.
Related, from the same reading
Found by an exhaustive read of natbib.sty, cite.sty, overcite.sty, biblatex, ltbibl.dtx and article.cls's thebibliography against this engine (full list in /Users/Shared/gotex/measure/biblio-latex.md, 28 divergences, 12 with a measured figure):
\citealp,\citealt,\citeyear,\citeyearpar,\Citet,\Citep,\citetext,\citetalias,\citepalias,\defcitealias,\shortcitesare defined nowhere in text mode. Strict mode fails; lenient mode sets the BibTeX key on the page.\bibpunctis\def\bibpunct#1{}againstnatbib.sty:292-302's seven-argument form, so\bibpunct[; ]{[}{]}{,}{a}{}{;}typesets; ][],a;into the first paragraph. Same shape as the\setcitestyledefect in natbib's key parser is undefined, so a class's \setcitestyle prints its key list — and on a two-column paper that costs a page #316.\newblockstays\spaceunder theopenbiboption wherearticle.cls:101-110makes it\par: two entries in 23.9pt against 75.7pt, a factor of three.
⚠ I verified the author-year table, the discarded optional argument and the population figures myself. The three bullets above are relayed from the reading and are not independently checked.
🤖 Generated with Claude Code
Activity
\@auxout is a real stream, so a package can talk to itself across pas…
tannevaled commentedon Nov 6, 2026
The engine side is done: the real
natbib.stynow runs, and matches the oracle exactlyWith #712 merged (
\@auxoutis a real stream), loading the genuine natbib 8.31b on this issue's own witness gives:Word for word, and the entry carries no bracketed number — all three defects this issue names.
-report-skippedreports no undefined commands skipped: the package loads whole. tectonic logs "Rerunning TeX because nat.aux changed", which is the same mechanism #712 gave us.That confirms #711's diagnosis: the package was never the missing half. The
.auxround-trip was.Four things were checked one at a time before this, each one refuted as the cause:
\def\NAT@bare#1(#2)#3(@)#4\@nil#5) — correct;\writeto a stream and\inputof it in the same pass — correct;\@input/\InputIfFileExistsexpanding a macro file name — correct;.auxcrossing from one pass to the next — correct.(My first run said the round-trip failed. The binary was built at 18:43 and #712 merged at 18:44 — a stale control, not a defect.)
So the whole issue is now delivery, and the corpus says it matters
populationover clean-list: 20 of the 154 papers\usepackage{natbib}.findover those twenty directories fornatbib.sty: none of them ships it. Every one falls back to the built-in emulation this issue measures, and every one of them would get the real package's output if the file were reachable.What is actually obtainable, checked
mirrors.ctan.org/macros/latex/contrib/natbib.zip749e9cc9…aa69. Containsnatbib.dtx,natbib.ins, the three.bstfiles — and nonatbib.stymirrors.ctan.org/install/macros/latex/contrib/natbib.tds.zipSo the bundle pattern in
go-tex/texmf(beamer, pgf, pgfplots, translator, Libertinus — pinned upstream archive, SHA256-checked, OCI mirror plus upstream source) does not apply unchanged: every one of those ships ready-to-use files, and natbib's CTAN archive ships docstrip source. The.styhas to be generated by runningnatbib.insonce, at packaging time.Licence
LPPL 1 or later, © 1993–2010 Patrick W Daly. The generated file adds one condition in its own header:
Mirroring
natbib.stytogether withnatbib.dtxinghcr.io/go-tex/texmf/natbibmeets that condition literally, and LPPL permits verbatim redistribution. Nothing LPPL-licensed enters this BSD-3-Clause repository — the existing texmf bundles already keep third-party LPPL/OFL material out of the tree and fetch it instead, so this follows the precedent rather than setting one.The open question is therefore narrow and practical, not legal: where does the docstrip run happen, so that the published
.styis reproducible from the archive we pin. Also worth taking in the same move:plainnat.bst,abbrvnat.bstandunsrtnat.bstride in the same archive and are the styles those twenty papers name.tannevaled commentedon Nov 6, 2026
What making natbib reachable is worth, on one of the twenty
Corpus paper 2111.13456, rendered twice with the same binary and the same font tree, the only difference being whether
natbib.styis on the search path:have indeed been obtained by [27]obtained by **Nordbotten et al.** [27]the recent work of [15] developedthe work of **Ern and Meunier** [15] developedpresented by [15]presented by **Ern and Meunier** [15][4, Section \S 3][4, Section §3]\citetwithout the real package loses the author name outright, and leaves sentences that are not English: "have indeed been obtained by [27]". 285 diff lines over the paper, 140 of them changed text.And the corpus metric barely sees it
pagedensagainst the reference, same three pages:One word. A restored author name is three or four words among two thousand, so word recall moves by nothing while the prose goes from broken to correct. This is the same blindness as #716 (kerning), from a different direction, and it means the value of this issue cannot be read off Σ — it has to be read off the text.
The witness for this issue should therefore be a citation-shaped check, not a corpus number: for each
\citetin a document, does the rendered line carry the author name the.bblentry's optional argument holds.tannevaled commentedon Nov 6, 2026
One more fact for the delivery question, and one thing I did not do.
natbib.insis plain TeX, and short:docstrip reads the
.dtxline by line through\openin/\read/\ifeofand writes through\openout/\write. This engine has all of them —readstreams.go:45-49registers\openin,\closein,\readand\ifeof, andwritestreams.goalready keeps written files in memory for\inputto read back. So "go-tex unpacks natbib itself from the archive we pin" is not obviously out of reach, and would remove the packaging step entirely rather than move it.Two things stand between that and a demonstration:
docstrip.texis itself generated (docstrip.dtx), so it is not downloadable from CTAN as a ready file —mirrors.ctan.org/macros/latex/base/docstrip.texis a 404. It comes from a distribution..insthrough a TeX engine is running external code, and that is a call for the project rather than something to do quietly in a measurement session.So the three candidate routes, in increasing order of what they ask of us:
docstrip.texreachable and the engine to survive it;natbib.sty+natbib.dtxtoghcr.io/go-tex/texmf/natbib;The licence permits all three; only the first avoids redistributing anything at all.
tannevaled commentedon Nov 7, 2026
The corpus number, on all twenty
Measured by wrapping the engine binary so
GOTEX_TEXMFgains the directory holdingnatbib.sty, and leaving the harness untouched: both sides are the same binary (e156591) scored by the same code, and differ only in whether the package is reachable.19 of the 20 documents render differently.
hashdiff natoff naton:Ink goes up on 15 of them — restored author names are glyphs that were simply absent.
And the page metric says something more interesting than "better"
The ten whose pagination moves:
Σ|·| 35 → 34, exact 1 → 2. Taken alone that reads as a small win, and it would be the wrong thing to take alone: the bias goes +1 → +20.
The split is clean and it is not noise. Every document that was short improves or becomes exact; every document that was already long gets longer. natbib restores content, content takes room, and pages grow. Where we were missing text that is a fix; where we already overflow it is a second defect being fed, not a regression caused by this one.
So two things follow, and the second is the one worth writing down:
\addvspaceepisode.A correction to #716
I wrote there that the fidelity metric cannot see this class of defect. That is true of
scoreandlabeldiff, and not true of the harness as a whole:hashdiffexists precisely for it, prints the ink delta per document, and ends by saying in so many words which documents the page metric cannot see. The gap is not a missing tool — it is that the routine sweep does not run the tool we already have.README: the size ladder, the kerning, and that the real natbib runs (#…
tannevaled commentedon Nov 15, 2026
The delivery question has a fourth route that was not on the list —
go-tex/texmf, already a direct requirement of this module — and it is blocked by exactly one thing, which is now measured rather than guessed.go-tex/texmfis the fleet's answer to this shape of problem, in its own words: "gets a TeX engine the support tree a document asks for, on a machine with no TeX distribution installed. It redistributes nothing. Every byte of TeX macro source comes from a pinned upstream release, fetched onto the user's own machine, checked against a recorded SHA-256, and kept in the user cache." Six bundles already:beamer,translator,pgf,pgfplots,linuxlibertine,libertinus.natbibis not among them, and a seventh entry is aBundleliteral — name, version, digest,Prefixes,Provides, twoSources.That would also settle the licensing point this issue's third comment raised about executing a downloaded
.ins: a fetch is not a redistribution, and nothing would be executed.What natbib's archives actually hold
natbib.sty?mirrors.ctan.org/install/macros/latex/contrib/natbib.tds.zipmirrors.ctan.org/macros/latex/contrib/natbib.zipnatbib.dtx,natbib.ins, the three.bst, two PDFs, READMEsmirror.ctan.org/systems/texlive/tlnet/archive/natbib.tar.xz.../historic/systems/texlive/2025/tlnet-final/archive/natbib.tar.xzThe TeX Live runtime package is exactly the five files this engine wants, nothing else:
CTAN says natbib is at 8.31b (LPPL 1.3), which is the version this issue's first comment loaded by hand.
⭐ And the payload is identical across the two routes, while the containers are not. Worth recording because it decides how a pin has to be written:
Same size, same file list, same bytes inside — different
.tar.xz. So aBundle's single digest has to name one archive (the frozen snapshot, mirrored byte-for-byte into ghcr as the first route), and "identical contents, different digest" is the normal state of two independently compressed tarballs rather than a sign that one of them is wrong.The one blocker
⛔
go-tex/texmfreads.zipand.tar.gz, and the only archive that carries a generatednatbib.styis.tar.xz. Itsgo.modis three lines and names no dependency at all; Go's standard library has no xz decoder. So this is not a missing bundle entry, it is a decision about that module:.tar.gz— but then the two routes no longer produce the same bytes, andtexmf's own invariant is that "a route is a delivery mechanism and never a trust anchor" because both routes are checked against one digest.docstrip.tex, itself shipped only inside a distribution, so it meets the same.tar.xzwall one layer down.⚠ Not claimed: that (1) is the right answer. I claimed a lease on
go-tex/texmf, read its catalogue andgo.mod, wrote nothing and released it — adding a first dependency to a stdlib-only module on my own judgement is the kind of decision that should be taken by whoever set that property, especially when option (2) is arguably the better design and costs no dependency at all.⚠ Also not claimed: that any of this changes the corpus figures in the fourth comment. The bias going +1 → +20 on twenty documents is unaffected by how natbib arrives; it is the next question after it arrives, and this comment says nothing about it.
🤖 Generated with Claude Code
natbib, and the .tar.xz reader it needs (#19)
tannevaled commentedon Nov 15, 2026
Correction, and then the thing that follows from it: delivery is now a one-line dependency bump, and this issue's remaining half is the corpus trade-off its fourth comment already measured.
The blocker I named was not one
My earlier comment here said the only archive carrying a generated
natbib.styis a.tar.xzand thatgo-tex/texmfcannot read one without spending its dependency-freego.mod. Both halves are true; the conclusion was wrong, because I priced four options without asking whether the fleet had already solved it.One call. At v0.3.1 its
reader.goimports only the standard library plus its owninternal/packages — theulikunitz/xzrequire is its test oracle — and it carriesMaxDictionary,ErrTooLarge,bombs_test.goandfuzz_test.go, which is the right posture for a decoder fed an archive off someone else's server.⚠ I also published a cost measured with the wrong command. "Two
go.sumlines" wasgo buildwithoutgo mod tidy; four is the honest number, andulikunitzis built into nothing (go list -deps ./... | grep -c ulikunitz→ 0).natbib is delivered
go-tex/texmf v0.8.0 ships the bundle:
tarxz.go, andNatbibpinned at TeX Live revision r79618 by a URL that names it. Its upstream pin is verified end to end — digest matched,natbib.styandbibentry.styextracted through the new reader — and that run now covers all seven bundles rather than the one it had been checking.⭐ And this engine needs no code at all for it
cmd/gotex/texmf.goalready resolves bundles generically:bundlesForReadingscans\documentclass/\usepackage/\RequirePackage, hands each name totexmf.Lookup, andNatbib.Providesis["natbib", "bibentry"]. Measured atmainc0d0d7d withtexmfbumped to v0.8.0 and nothing else changed:The two controls matter: another bundle still resolves, and a document naming none still fetches nothing. So the delivery question this issue has carried since 2026-11-06 closes with
go get github.com/go-tex/[email protected].⛔ Which is why I have NOT opened that bump
The fourth comment here already measured what making natbib reachable does to the corpus, over all twenty documents, with the same binary on both sides. That measurement is not mine and I am not re-claiming it: Σ|·| 35 → 34 and exact 1 → 2, but the bias goes +1 → +20, with every document that was short becoming long. One exact document was lost (2308.00461, 0 → +1).
So the remaining half of this issue is not plumbing, it is that trade-off: restored author names make the prose correct — "have indeed been obtained by [27]" becomes "obtained by Nordbotten et al. [27]" — while pagination moves away from the reference on the documents that were already over. A one-line bump that does that deserves the decision it implies, not a merge because it is easy.
⚠ And it cannot be re-measured right now: the host's 1-minute load average has been 14.6 to 22.3 all day, over the ~8 threshold this repository measures under. Deferred and said out loud rather than taken badly.
Staying open on that question. The blocker is gone; the choice is what is left.
🤖 Generated with Claude Code
texmf: embed natbib.sty, so \citet prints the author name (#801)
tannevaled commentedon Nov 25, 2026
Verified on current main with texmf v0.9.0 pinned:
TestEmbeddedNatbibPutsTheAuthorNameOnThePage(natbibembedded_test.go) passes, and the page text it reads back carries the author name and the reference entry:That is the three defects this issue named: the citation prints the author-year form, the entry is not preceded by a bracketed number, and the package loads whole. The control is the one the first comment proposed: the rendered line carries the author name, not what the page-error sum did.
Closing as completed.