Skip to content

render-pipeline: real-world page counts (twocolumn title, nosep lists, float bodies) - #117

Closed
GoKubar wants to merge 1 commit into
mainfrom
agent/kabir-claude/realworld-pagecounts
Closed

GoKubar wants to merge 1 commit into
mainfrom
agent/kabir-claude/realworld-pagecounts

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Fixes the two real-world page-count mismatches from the corpus report (#112): article-twocolumn rendered 1 page (pdflatex 2), cv 2 pages (pdflatex 1). Scope: crates/render-pipeline non-vendored source only.

Root causes and fixes

cv: \begin{itemize}[nosep,leftmargin=1.5em] was never read for spacing. Only \setlist reached list_seps, so each item kept article's \itemsep, \parsep and \topsep (22.5pt pitch vs 13.6pt). The list's own \begin keys now apply after \setlist:

  • nosep zeroes all four skips;
  • noitemsep zeroes \itemsep and \parsep;
  • a shortlabels template such as [(a)] is not read as keys.

article-twocolumn:

  • Title across both columns. \maketitle was set inside column 1. It is now \twocolumn[\@maketitle] (\@topnewpage): a \textwidth box above both page-1 columns, whose \@colht is \textheight minus the box height.
    • Box contents: \null\vskip2em, the title, \vskip1.5em, the authors, \vskip1em, the date, \vskip1.5em, using the \LARGE/\large baselineskips.
    • New plumbing: Doc::title_parts, pagebuild::break_pages_cols, and a first_colht argument on floatpage::paginate.
  • Abstract. A two-column abstract is now article's \section*{\abstractname}.
  • graphicx demo. \includegraphics draws a black rule of the requested size (150×100pt by default). No file is read and no image_unavailable error is raised.
  • Tabular inside a float. It keeps its box height, computed from the compiler's tabular model (struts × \arraystretch, \hline, booktabs rules, [c] centred on the axis). Cells and rules are still not painted; a warning reports this for the tabular lane to replace.

Results (MacTeX 2026 pdflatex oracle, pdftotext)

fixture pages before, after, pdflatex notes
article-twocolumn 1, 2, 2 Title baseline 95.8 vs 95.9pt; first author row 124.7 vs 124.8pt; table box within 1.4pt; page-2 last line matches
cv 2, 1, 1 First and last line match
hw1, hw2, input-bibliography, lecture-notes, letter, math-sheet, unicode-accents unchanged v2 display lists byte-identical to base a630863, all binaries run from the same working directory

cargo test --release in render-pipeline is green, including page_frame. New unit tests cover nosep, the two-column abstract and title parts, demo, tabular ranges, the booktabs box height and break_pages_cols.

Remaining page-1 difference (outside this lane)

Page 1 of article-twocolumn still sits +12.7pt (one line per column) below pdflatex, so the page-1 first/last lines are one line off. Both causes are in the compiler:

  • \and authors are set one per line (4 rows), where pdflatex puts side-by-side tabulars (3 rows). This belongs to the maketitle/compiler lane.
  • \TeX and \LaTeX are unsupported, which drops words and changes line breaks.

With both emulated in a scratch copy, each column is within one line. The rest is the \texttt{SOURCE\_DATE\_EPOCH=0} line break.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

…, float bodies)

article-twocolumn rendered 1 page (pdflatex 2) and cv 2 pages (pdflatex 1).

cv: enumitem `\begin{itemize}[nosep,...]` keys were never read; only
`\setlist` reached `list_seps`, so every item kept article's `\itemsep`/
`\parsep`/`\topsep`. The list's own `\begin` options now apply after
`\setlist` (`nosep` zeroes all four skips, `noitemsep` `\itemsep`/`\parsep`,
explicit keys as before; a shortlabels template is not read as keys).

article-twocolumn:
- `\maketitle` in a two-column article is `\twocolumn[\@maketitle]`
  (`\@topnewpage`): the title parts are now set at `\textwidth` above both
  columns of page 1, whose `\@colht` is `\textheight` less the box
  (`\null\vskip2em` title `\vskip1.5em` authors `\vskip1em` date
  `\vskip1.5em`, `\LARGE`/`\large` baselineskips). The adapter marks the
  lowered title paragraphs (`Doc::title_parts`); the page builder and float
  placer take a per-column height (`break_pages_cols`, `paginate`'s
  `first_colht`), and page-1 lines and float items are shifted below the box.
- two-column `abstract` is article's `\section*{\abstractname}`.
- graphicx `demo`: `\includegraphics` is a black rule of the requested width
  and height (150pt x 100pt default), no file read, no image_unavailable.
- a `tabular` inside a float keeps its box height (struts x `\arraystretch`,
  `\hline`, booktabs rules, `[c]` on the axis) from the compiler's tabular
  model; cells/rules are still not painted (reported).

Result (pdflatex MacTeX 2026 oracle): article-twocolumn 2 pages, title
baseline 95.8 vs 95.9pt, first author row 124.7 vs 124.8pt, page 2 last line
matches; cv 1 page, first/last line match. hw1, hw2, input-bibliography,
lecture-notes, letter, math-sheet, unicode-accents display lists
byte-identical to a630863. cargo test --release green (page_frame included).

Remaining article-twocolumn page-1 offset (+12.7pt, one line per column) is
the compiler's one-author-per-line `\and` (pdflatex: side-by-side tabulars)
plus unsupported `\TeX`/`\LaTeX` text changing line breaks.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude realworld page counts, 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 #135, which itself landed as b6752e7 (#357) and e3fa43e (#382)

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/realworld-pagecounts 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