Skip to content

render-pipeline: list layout fidelity vs pdflatex (list oracle 28/39) - #143

Closed
GoKubar wants to merge 2 commits into
mainfrom
agent/kabir-claude/list-fidelity
Closed

GoKubar wants to merge 2 commits into
mainfrom
agent/kabir-claude/list-fidelity

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

List layout in the main flow, checked against pdflatex (MacTeX 2026). This PR is based on main 85ec30c and is not stacked on another PR. It touches no vendor code.

Fixes (render-pipeline only)

  • em = the current font's quad (\fontdimen6, document-style's size1x.clo table: cmr12 11.74988pt, 10.95003pt at 11pt). This fixes list indents at 12pt, which were 0.62 bp too far right.
  • twocolumn margins: \leftmargini is 2em and \leftmarginv/vi are .5em (article.cls \if@twocolumn). This fixes a 4.98 bp error.
  • \@endpe after lists: a paragraph right after \end{itemize|enumerate} is no longer indented.
  • trivlist skips (latex.ltx \@trivlist, \@endparenv, \@item, \@nbitem, \@xaddvskip):
    • A list end uses its own level's \@topsepadd, not level 1's.
    • Successive \addvspaces keep the maximum: list end then next \item, list end then \begin{center}, and center then flushleft.
    • A \begin right after \end{env} or a heading reads in vertical mode, so it adds \partopsep.
    • After a heading, a negative \@nbitem skip is applied.
    • Together these fix the 9.96 bp consecutive-list offset and the nested level 3/4 offsets.
  • enumitem \begin keys: nosep, noitemsep, topsep/partopsep/itemsep/parsep and labelsep (enumitem.sty \enitkv@key{}{nosep} and following). A key list is no longer read as a shortlabels template.
  • Labels:
    • Label style follows \@itemdepth/\@enumdepth: \labelitemi..iv (bullet, \bfseries en dash, asterisk, cdot) and \labelenumi..iv (arabic, (alph), roman., Alph.). This is derived from source because the vendored compiler gives •/N. at every depth.
    • The symbol labels use cmsy widths via Latin Modern Math. They were 2.77 bp off before.
  • quotation: \listparindent and \itemindent of 1.5em.

Oracle

  • tests/list_corpus: 39 fixtures and a pdflatex word-position generator (oracle.py refs|check). Cargo never runs TeX.
  • Coverage: itemize, enumerate and description at 10/11/12pt; one and two columns; nesting to depth 4; consecutive lists; lists after headings and displays; multi-paragraph items; quote, quotation, verse and center next to lists; enumitem keys.
  • Result: 28/39 match within 0.5 bp in words and labels (main: 7/39). tests/list_oracle.rs gates the 28.
  • Pending (listed in the test):
    • 10 fixtures are blocked on the vendored compiler: description and \item[..] (7), noitemsep read as a template, start=/resume, and verse.
    • 1 fixture is pipeline work: quote nested in a list.

Gates

  • render-pipeline cargo test --release: all green, including page_frame, floats_oracle, tabular_oracle, list_items and paragraph_styles.
  • HW1/HW2: every word is identical to main. Both are 11pt with enumerate[(a)] at level 1, whose geometry was already right. The \item first-line residuals there belong to the HW glyph-residuals lane.
  • Real-world corpus, main vs branch: nothing is worse. cv now has the reference page count (1, was 2) and 212 aligned words (was 203).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

GoKubar and others added 2 commits September 13, 2026 08:00
…rivlist skips, labels)

- em lengths are the body font's quad (\fontdimen6: cmr12 11.74988pt),
  \leftmargini 2em in twocolumn (article.cls \if@twocolumn)
- \@endpe after \end{itemize|enumerate}: no indent on the next paragraph
- \@endparenv skips use the closed list's own level and combine with the
  next \item/\begin as \addvspace (max, not sum); \begin after \end{env}
  reads in vertical mode (\partopsep); negative \@nbitem after headings
- enumitem \begin keys: nosep, noitemsep, topsep/partopsep/itemsep/parsep,
  labelsep; key lists no longer read as shortlabels templates
- article labels by \@itemdepth/\@enumdepth (bullet, bold en dash,
  asterisk, cdot; arabic/alph/roman/Alph) with cmsy metrics for symbols
- list_corpus: 39 pdflatex fixtures + oracle.py; list_oracle gate (24)

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list fidelity, 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
…t 28/39

- quotation: \listparindent = \itemindent = 1.5em (article.cls), told
  apart from quote by the enclosing environment in the source
- oracle.py reads label runs glyph by glyph (all label glyphs share the
  \item span, so cluster bytes misspelled them)
- list_oracle gates 28 fixtures; the 11 pending ones name their cause

Implementation-Agent: Claude Opus 5 (subagent kabir-claude list fidelity, 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
@GoKubar

GoKubar commented Sep 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing as superseded — the work is already on main.

Replacement: superseded by #152, per its own body ("supersedes #143 once both land")

Closed by the integration lane while clearing a 219-PR backlog (112 of them drafts). If this is wrong, reopen it and tell me — I would rather be corrected than leave stale work buried.

— orchestrator-astra (Commander)

@GoKubar GoKubar closed this Sep 15, 2026
@GoKubar
GoKubar deleted the agent/kabir-claude/list-fidelity branch September 16, 2026 04:18
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