Repository navigation
render-pipeline: preamble page-geometry and paragraph lengths reach the page frame and MediaBox - #433
Merged
Conversation
…h \setlength/\addtolength The pipeline half of lane #258, split from agent/daniel-parent/preamble-lengths @ 695dfaa (20 reviewed WIP commits). The compiler half is its own PR. - Preamble assignments to \textwidth, \textheight, the margins, \headheight, \headsep, \footskip, \paperwidth/\paperheight, \parindent and \parskip are applied to the page frame. \addtolength accumulates, and \parskip keeps its glue stretch and shrink. - With geometry, paper-size assignments set the PDF MediaBox; without it they only move the frame, as in LaTeX. - Heading specs are re-derived when \parindent was assigned. - The scan is one linear pass that skips % comments, braces and \newcommand/\renewcommand/\def bodies (including a \begin{document} inside one) and honours group scope. A 1 MB source went from 63 s to under the test bound. What was run (CARGO_TARGET_DIR=target-verify, against the current vendored compiler pin): test result: ok. 121 passed; 0 failed; 2 ignored (render-pipeline --lib) test result: ok. 5 passed; 0 failed; 0 ignored (--test preamble_lengths_oracle) Known limits (ignored tests): \input-ed preamble files, \@setlength. Length references use final geometry rather than source order. Implementation-Agent: cursor-agent cursor-grok-4.6-high-fast (lane commits ae37132..695dfaa) Commit-Executor: daniel-parent (split into compiler and pipeline PRs) Lane-Owner: daniel-parent (mac-m5pro-dq222) Claude-Session: https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz
This was referenced Sep 14, 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.
daniel-parent (Cursor Grok lane
GH-PREAMBLE-LENGTHS, reviewed by daniel-parent plus two independent read-only Codex reviews). Render-pipeline half. The compiler half is the companion PR; the two are independent, and either can merge first.What changes
Page frame: preamble assignments to the following are applied:
\textwidth,\textheightand the margins;\headheight,\headsepand\footskip;\paperwidth/\paperheight;\parindentand\parskip.\addtolengthaccumulates, and\parskipkeeps the class's glue stretch and shrink.Paper size: with
geometry, paper-size assignments set the PDF MediaBox. Without it they move only the frame, as in LaTeX. The values are pinned from pdflatex measurements.Headings: heading specs are re-derived when
\parindentwas assigned, so\subparagraphfollows\setlength{\parindent}{0pt}. The re-derivation only runs when needed, so documents that set no lengths are unchanged.The scan:
%comments and\newcommand/\renewcommand/\defbodies (including a\begin{document}inside one) and honours group scope.\begin {document}.Review rounds
First review, REQUEST_CHANGES:
\addtolengthwas overwritten by the oldersetlength_inpath;\parskipstretch was lost;\parindent;All fixed.
Re-review: it confirmed those FIXED and found:
brace_depthrescans;\begin{document}inside a macro body taken as the boundary;All fixed.
read_groupstays separate frommatching_brace, which neither skips%comments nor yields the inner bytes, so{6in%\n}would break.Tests
Run on this branch against the current vendored compiler pin:
test result: ok. 121 passed; 0 failed; 2 ignored(render-pipeline lib; the 2 ignored are\inputpreambles and\@setlength)test result: ok. 5 passed; 0 failed; 0 ignored(preamble_lengths_oracle, with values pinned from pdflatex measurements or class arithmetic, as commented)Overlap check
b529e9d3, including render-pipeline:\paragraph/\subparagraphare run-in headings #404's run-in headings, which this re-derives consistently.vendor/changes.\addtolength, although the layout is applied.Not done
\setlength{\parskip}{\textwidth}before\usepackage[…]{geometry}.\input-ed preamble files and\@setlength(tests ignored).🤖 Generated with Claude Code
https://claude.ai/code/session_012c9XLkHjePPGBuarrmE2mz