Repository navigation
render-pipeline: \limsup and \liminf have a thin space inside them - #462
Merged
Merged
Conversation
GoKubar
changed the base branch from
agent/kabir-claude/math-text-italic-correction
to
main
September 14, 2026 19:57
They are the only two of the kernel's thirty-odd log-like functions whose
definition is not a single word (latex.ltx 15528-15529):
\DeclareRobustCommand\limsup{\mathop{\operator@font lim\,sup}}
\DeclareRobustCommand\liminf{\mathop{\operator@font lim\,inf}}
The compiler has no glue inside a named operator and emits one
`Nucleus::Text("limsup")`, so the `\,` is lost. It is re-derived from the
control word at the atom's span (`operator_thin_space_split`) and the operator
becomes `lim` + 3mu + `sup`, as an Op atom whose nucleus is that list -- which
is also what TeX has, so `make_op`'s delta stays 0 and the Rule 13a limits are
not shifted.
Splitting the word also earns `lim` its own italic correction: its `m` is now
followed by glue rather than by a math character of the same family, so §753's
`make_ord` never demotes it to a `math_text_char`. pdfTeX's box is
`l i m \kern0.05731 \glue 1.99997 s u p`, so the gap from `m` to `s` is
2.05728 pt -- a fix that inserted only the thin space would still be 0.057 pt
short. `\liminf` likewise closes with `f`'s `\kern0.84708`.
Oracle: TeX Live 2025 pdflatex under the harness preamble, `\showbox`.
pdflatex is an oracle only and is never in the product path.
No corpus effect: the 22 fixtures contain no `\limsup` or `\liminf`. The fix
is carried by the oracle numbers and the new regression test, which fails on
main by exactly -2.0496 bp.
Gates: render-pipeline suite green, amsmath 59/59, tabular 106/106, corpus
22/22 fixtures with no page-count mismatch, zero font-FAILURE diagnostics.
Implementation-Agent: Claude Opus 5 (lane nixos-math-detail, linux-primary)
Commit-Executor: Claude Opus 5 (direct git, observed Cursor usage limit)
GoKubar
force-pushed
the
agent/kabir-claude/limsup-thin-space
branch
from
September 14, 2026 20:00
f4b438c to
f818952
Compare
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.
Stacked PR 2 of 3 (math detail, lane
nixos-math-detail). Base:agent/kabir-claude/math-text-italic-correction(#461) — review that first;this diff is only the second commit.
Mechanism
\limsupand\liminfare the only two of the kernel's thirty-odd "Log-likefunctions" whose definition is not a single word (latex.ltx 15528–15529):
The compiler has no glue inside a named operator and emits one
Nucleus::Text("limsup"), so the\,is lost and we set one word with a zerogap. The space is re-derived from the control word at the atom's span
(
operator_thin_space_split) and the operator becomes anOpatom whosenucleus is the list
lim+ 3mu glue +sup.That is also TeX's own shape, which matters: with a
sub_mlistnucleusmake_optakes theelse delta:=0branch, so the Rule 13a limits get no ±δ/2shift.
Nucleus::Listalready yields δ = 0 in math-layout, so the structuresagree.
The part that is easy to get wrong
Splitting the word also earns
limits own italic correction. Itsmisnow followed by glue rather than by a math character of the same family, so
§753's
make_ordnever demotes it to amath_text_charand §752 leaves it itsdelta:So the gap from
mtosis 2.05728 pt, not the 1.99997 pt of the gluealone — a fix that inserted only a thin space would still be 0.057 pt short.
\wdconfirms it from the other side:$\mathrm{limsup}$is 34.01064 pt and$\limsup$is 36.06792, and the difference 2.05728 is exactly the correctionplus the glue.
\liminflikewise closes withf's\kern0.84708, which itgets for free from #461.
Oracle
TeX Live 2025 pdflatex under the harness preamble,
\showbox/\showthe\wd.pdflatex is an oracle only and is never in the product path.
Regression test
crates/render-pipeline/tests/math_operator_thin_space.rs. Onmain:(9.7554 bp is
m's own advance, i.e. no gap at all.) The third test,mathrm_limsup_is_one_word_with_no_thin_space, passes on main and is a guardthat the split comes from the control word and not from the letters.
Corpus
No effect: the 22 fixtures contain no
\limsupand no\liminf(checkedby grep, and the corpus numbers are byte-identical to #461's). This fix is
carried by the oracle and the regression test, not by the corpus — stating
that plainly rather than implying a win that is not there.
Gates
render-pipeline suite green (exit 0), amsmath 59/59, tabular 106/106, corpus
22/22 fixtures with no page-count mismatch and no producer failure, zero
font-FAILURE diagnostics. Pipeline-only; nothing under
vendor/is touched,so no re-pin is needed.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu