Repository navigation
render-pipeline: display math placement (leqno, fleqn, \eqno, \tag*, after headings, lists; oracle 19→29/36) - #146
Merged
Conversation
…no, \tag*, after headings, lists; oracle 29/36)
Display rules of TeX 1145/1199-1205 and amsmath's \mathdisplay, measured
by a new 36-fixture pdflatex oracle (fixtures/display-placement; main 19/36):
- amsmath leqno: numbers left, normal skips (1203); fleqn: formula at
\@mathmargin, tags per \emdf@R/\emdf@L; align/gather under both.
- primitive $$ ... \eqno/\leqno $$ numbers (read from source).
- \tag* without parentheses; counter numbers formatted in the adapter.
- a display right after a heading sets no empty line (1145).
- text after a display carrying \label, and displays inside quote and
list items, continue the paragraph (no indent, short skips).
- the short-skip test is d + s <= \predisplaysize, not a too-wide flag.
Not yet: glue shrink of too-wide formulas (math-layout glue has no shrink),
\numberwithin/subequations (compiler counter), \tag{$..$}, nested list
labels. amsmath corpus 42/42; HW1/HW2 byte-identical to main.
Implementation-Agent: Claude Opus 5 (subagent kabir-claude display math placement, 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
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.
Display math placement in running text: TeX §1145/§§1199–1205 and amsmath
\mathdisplay, measured against pdfLaTeX (MacTeX 2026).Oracle
crates/render-pipeline/fixtures/display-placement/: 36 fixtures (gen_fixtures.py), pinned pdflatex word positions (refs/),oracle.py check(0.5 bp, multi-page; shares the amsmath corpus word forming). Cargo testtests/display_placement.rschecks the 29 passing fixtures from the pinned refs (never runs TeX).main 19/36 → branch 29/36. Newly passing: 06 equation leqno, 07 fleqn, 08 fleqn+leqno, 12
$$\eqno$$, 13$$\leqno$$, 19 itemize display, 21 display after heading, 29 quote display, 31\tag/\tag*, 35 12pt fleqn+leqno align. Passing on both: short/long preceding line, paragraph start,$$,equation*, gather numbers, page top/bottom/widow, 11pt/12pt, multline, consecutive displays, CM fonts.Still failing (words within 0.5 bp noted): 09/10/33 too-wide formula — TeX shrinks its glue to z−q (math-layout
Gluehas no stretch/shrink; math-layout PR needed); 15\tag{$*$}math in tags (all positions exact, text differs); 17\numberwithinand 18subequations(compiler's equation counter is a plain u32; compiler PR needed); 20 nested enumerate label/end-of-list spacing (list lane).Oracle note: the amsmath corpus reads any candidate
()[]…glyph at 10 bp as a cmex glyph (its fixtures are 12pt); at 10pt body that hid the parentheses of(1). This corpus has no cmex glyphs and disables that classification.Fixes (render-pipeline only, no vendor edits)
leqno(amsmath option, class or package): number at s, formula at s+z−w−d, normal skips (§1203–1204).fleqn: formula at\@mathmargin(\leftmargini), tag right after\hfilor left with\mintagsep(\emdf@R/\emdf@L);$$stays centred.align/alignat/flalign/gathershift under fleqn/leqno, tags left under leqno.\eqno/\leqnoin$$…$$: number read from source, side from the command.\tag*without parentheses (label text kept as set; counter numbers get\tagform@parens in the adapter).\@afterheadingempties the paragraph), only\parskip;\predisplaysize= −∞.\label, and displays insidequote/list items, continue the paragraph (no indent, short skips).s + d <= \predisplaysize; a too-wide formula no longer forces normal skips.Gates
cargo test --releasegreen.\labelled equation no longer indented, now matches pdflatex (x at column edge,evalu-hyphenation as in the reference). math-sheet:\[after\section*loses its spurious empty line; gaps between headings move toward pdflatex (Piecewise→Limits ref 87.2 / main 101.5 / branch 87.6); absolute positions stay off because\maketitleis not laid out on main (render-pipeline: \maketitle layout, titlepage, twocolumn title, book matter #114).🤖 Generated with Claude Code
https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu