Skip to content

render-pipeline: float bodies and two-column wide floats (supersedes #123, based on main) - #135

Closed
GoKubar wants to merge 7 commits into
mainfrom
agent/kabir-claude/float-bodies-r
Closed

GoKubar wants to merge 7 commits into
mainfrom
agent/kabir-claude/float-bodies-r

Conversation

@GoKubar

@GoKubar GoKubar commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #123 (float-tables + realworld-pagecounts): one branch based on main 85ec30c, keeping #122's \maketitle design, plus float bodies and figure*/table* in two-column documents.

Rebase onto 85ec30c

New

  • Float bodies set by the main flow's block layout (layout_blocks, extracted from build_with_floats): lists, displays (equation, align*, \[..\]), headings, tikzpicture, rules. Also \@setminipage (the first \addvspace does nothing), the list's closing \@topsepadd at the box end, and pre_display_size = max under \centering (TeX §1146).
  • Lines of boxes: \includegraphics and minipage with \hfill/\hfil/\quad/\qquad/\enskip/\hspace and interword spaces. minipage [t]/[c]/[b] (\vtop/$\vcenter$/\vbox), a caption number per \caption, \linewidth/\textwidth inside minipages.
  • Two-column wide floats, transcribed from latex.ltx 2026: \end@dblfloat puts them in the same float lists, where \@testwrongwidth keeps them out of columns. Each new page runs \@dblfloatplacement + \@startdblcolumn (\@tryfcolumn wide float pages, \@addtodblcol), then \@combinedblfloats with \dblfloatsep/\dbltextfloatsep. \@doclearpage flushes remaining wide floats at \end{document}.
  • floatpage::paginate sets each text column \vbox to\@colroom like pagebuild (shrink; stretch under \flushbottom): pdflatex's page 1 is identical with and without a figure*, while ours drifted 0.44bp per paragraph.

Gates (MacTeX 2026 pdflatex oracle, test-only)

  • New tests/float_bodies_oracle.rs on fixtures/float-bodies (20 fixtures, generator make_fixtures.py + oracle.py): lists, enumerate after text, equation/align*/\[..\] in figures, heading, TikZ, \hfill/\quad/space between graphics, two captioned minipages, [t] minipages, figure* on page 2, figure* + figure ordering, table* + figure, two figure*, figure*[p] float page, end-of-document flush, table* + column table. 20/20 within 0.5bp words and 0.1bp rules; worst word 0.007bp.
  • float_tables_oracle 14/14, floats_oracle, page_frame (incl. render-pipeline: \maketitle layout, titlepage, twocolumn title, book matter (rebased on 1d4604d4) #122's title fixtures), tabular_oracle, lib tests: pass. cargo test --release green.
  • Column glue: \@make@normalcolbox sets the text, \floatsep/\textfloatsep and the floats together \vbox to\@colht (\flushbottom stretch, shrink when too tall).
  • HW1/HW2 display lists and PDFs byte-identical to 85ec30c; input-bibliography, lecture-notes, letter, math-sheet, unicode-accents byte-identical. article-twocolumn 1 -> 2 pages and cv 2 -> 1 page (pdflatex: 2 and 1; render-pipeline: typeset float bodies (tabulars drawn in floats) #123's fixes).

Main-flow residuals found (reproduced without floats; not float code)

  • 12pt lists: \leftmargin is 2.5em taken at 12pt rather than the font quad (+0.62bp).
  • Two-column lists: \leftmargini should be 2em (+4.98bp).
  • A list right after a list sits 9.96bp low.
  • description label placement.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu

GoKubar and others added 6 commits September 13, 2026 06:23
…, 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
…ecounts' into agent/kabir-claude/float-tables
…izes)

A float body is now set like the main flow instead of only
\includegraphics/\caption: the body bytes are parsed on their own (preamble
kept; \caption/\includegraphics become \par, \label spaces, offsets kept)
and every paragraph (text, tabular via table.rs with cells and rules
painted, \centering/center) is placed in the float's \vbox in source order
with the captions and graphics:

- \@parboxrestore: no \parindent, \parskip 0, \sloppy (captions too);
  \@floatboxreset \normalsize + \@setminipage: \addvspace does nothing until
  the first paragraph or caption, so a leading center adds no \topsep while
  \end{center} adds \@topsepadd.
- \@caption is \normalsize with \abovecaptionskip before and
  \belowcaptionskip after, above or below the table.
- top-level \small/\footnotesize/... set the \baselineskip of what follows;
  paragraphs use their own size's \baselineskip.
- \vspace before a paragraph; figure*/table* use \textwidth as \hsize.
- the adapter's environment skips are kept only where the float body itself
  holds \begin/\end of a paragraph-shape environment (in the isolated body
  its gap scan reached the preamble's \begin{document}).
- lists, display math, headings and tikzpicture in floats are reported
  (float_content_unsupported) instead of the old tabular height placeholder.

Oracle: fixtures/float-tables (14 pdflatex MacTeX 2026 fixtures, generator
make_fixtures.py + oracle.py reusing the tabular corpus extraction);
tests/float_tables_oracle.rs: 14/14 within 0.5 bp words, 0.1 bp rules.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float tables, 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
…o-column wide floats

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, 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
Rebase of #123 (realworld page counts + float-table bodies) and the float-bodies work onto main, keeping #122's \maketitle design: lower_blocks(stash_titles) with Block::Title, break_pages_shortened and top_title. #123's own twocolumn-title path (Doc::title_parts, break_pages_cols, span_title) is dropped; floats are threaded on top: paginate takes #122's shortened first page (first_colht) and float items are shifted below the \twocolumn[\@maketitle] box instead of the old 'floats do not shorten' warning. #123's nosep lists and two-column abstract are kept (lower_blocks gains a twocolumn flag).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, 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
…s off main-flow list residuals

floatpage::paginate now sets each text column \vbox to\@colroom like pagebuild::break_pages (shrink when too tall, stretch under \flushbottom at an ordinary break): pdflatex page 1 of a two-column document is identical with and without a figure*, and ours drifted 0.44bp per paragraph. Float-body fixtures 01/02 move to 10pt and 03 to enumerate, 20 to a paragraph in table*: the 12pt list \leftmargin (2.5em taken at 12pt instead of the font quad), two-column \leftmargini (2em), consecutive lists and description labels are main-flow list residuals, reproduced without floats. floats unit test accounts for the Space piece.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, 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
…racle 20/20

\@make@normalcolbox unvboxes the text, the top floats with \floatsep/\textfloatsep (\@cflt) and the bottom floats (\@cflb) into \vbox to\@ColhT, so under \flushbottom the separators stretch with the text glue (fixtures/float-bodies 16: a column figure[t] in a two-column page). tests/float_bodies_oracle.rs no longer ignored: 20/20 within 0.5bp words and 0.1bp rules against pdflatex (MacTeX 2026).

Implementation-Agent: Claude Opus 5 (subagent kabir-claude float bodies 2, 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 added a commit that referenced this pull request Sep 13, 2026
#135 splits build() into a reusable layout_blocks(doc_blocks) -> Flow so float
and minipage bodies are set by the same code, while main had added two-column
bookkeeping (page_start_blocks, wide_blocks, clears) computed in what is now
layout_blocks but consumed in what is now build_with_floats, reading a
doc.page_starts that layout_blocks no longer receives. Carried it across the
split: layout_blocks takes page_starts, Flow carries the three vectors, and the
float-body call site passes an empty slice.

floats.rs took #135's Prep body builder over main's inline piece loop.

Vendor re-pins for this stage stay uncommitted by instruction; see
docs/evidence/integration-2026-09-13b/tools/repin.sh.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
Two feature overlaps with #154 resolved in favour of the more general side: #151's for_text_size/math_fonts_at supersede #154's at_text_size (removed, with its duplicate field and math_box arity restored to #151's wrapper plus math_box_sized). break_pages_inserts and break_pages_tops remain separate page builders; footnotes win and the combination now warns. layout_blocks gained has_floats and Flow gained chapter_tops, as #135's split requires.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
Took #152's list refactor (class_seps/apply_sep_keys/is_key_list, env_shape, three-tuple list_stack_at) over main's inline loop, but kept main's outer_parskip default and #135's hsize() for paragraphs inside float and minipage boxes; style.rs keeps #151's five headings and the class labelsep alongside #152's em_pt.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
main added \caption[short]{..} to floats::Piece::Caption (latex.ltx
\@caption#1[#2]#3 writes #2 to the list of figures/tables) while #135's
Prep::parts predates the field. The float body sets only the caption that
appears on the page, so short is ignored there.

render-pipeline is now blocked by exactly one thing: the Inline::Graphic and
Inline::Transform arms owed by #170. The merge log records the worked-out
resolution for #170's display-wire half.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-kabir)
Commit-Executor: Claude Code direct Git
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xd5Hmwh5GHNTiAmHUJ1MZu
GoKubar added a commit that referenced this pull request Sep 13, 2026
Reconstructed, not textually merged: 38 conflicts across 11 files. Part 1 (display wire) follows the merge log: transforms joins main's display::Wire and the parallel *_caps family is dropped. Part 2 (float bodies, adapter/typeset arms) rebuilt from the three merge stages as #154 was, because #135 and #170 both rewrote that code. graphics_oracle 24/24 vs MacTeX; render-pipeline builds for the first time since stage 2.

Implementation-Agent: Claude Opus 5 (subagent kabir-claude integration, nixos-pc-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: b6752e7 "a float body is typeset..." (#357) and e3fa43e figure*/@dbflt (#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)

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