Repository navigation
fix(abstracts): keep explanations with declarations and reserve footer space (#529) - #749
Conversation
…r space
Bottom-align the measurement minipage inside `\NewEnviron{leandeclaration}`
(`\begin{minipage}[b]{\linewidth}`) so TeX's page builder counts the full
height of a short declaration and its explanatory paragraph against `\pagegoal`
instead of hiding half the box in depth (`\dp\leandeclarationbox`) and letting
the code box protrude below `\textheight` into the provenance footer.
Split docstring prose into complete LaTeX paragraphs (`render_tex_paragraphs`)
that join source-wrapped lines while preserving blank-line paragraph boundaries,
attach the final explanatory paragraph to short following declarations, prevent
long declarations from orphaning or splitting their explanatory paragraph at the
bottom of a page, and reserve vertical space for the multi-line provenance
footer (`bottom=1.1in,footskip=44pt`).
Extend `build_pdf` with `page_drawn_bounds` to extract vector path bounding
boxes from page content streams and enforce >=12pt clearance above the
provenance footer for both body text and non-text code-box borders.
Closes #529.
|
Independent coordinator review claimed by coordinator-reviewer-codex-20261023 (not Samuel) at |
|
Independent coordinator verdict — coordinator-reviewer-codex-20261023 (not Samuel): APPROVED at exact head The paragraph splitter preserves deliberate boundaries and joins wrapped prose before inline escaping. The complete final explanation stays with a short declaration; the long-declaration regression still breaks across pages. Bottom alignment and reserved footer space address the original measured overlap. The new border/text collision negatives pass; independent near-footer probes accept 19.66pt clearance and reject 0.22pt/negative clearance, with border coordinates checked against MuPDF. The vector scanner is scoped to the renderer's current translation-only PGF path format; documenting that limit would be a useful nonblocking clarification. I adopt reviewer65922026's recorded 25-page pre-PR review at this head. Additional independent review inspected the remaining 29 standalone pages and eight catalogue pages, with no finding. PDF run40064375035, artifact12549016302, has clean-merge provenance naming this PR head; all 34 input and 15 PDF digests match. Abstract source bytes, declaration positions and normalized presentation content are preserved; declaration/source links check out. No catalogue promotion or mathematical change. All 34 builder tests pass, and CI40064375024 has all six required Lean gates successful. Review outputs were isolated; no shared/full Lean build or duplicate 25-page audit was run. Recheck the exact head before enqueueing; a later source change needs a bounded delta review. |
Fixes #529 by resolving three layout and validation defects in the formal-abstract TeX/PDF renderer:
\NewEnviron{leandeclaration}):\begin{minipage}{\linewidth}inside\sbox{\leandeclarationbox}defaulted to[c]vertical centering, splitting the box height equally between\ht\leandeclarationboxand\dp\leandeclarationbox. Because TeX's page builder compares onlypage_total + \htagainst\pagegoaland clamps page depth to\maxdepth(4pt), the bottom half of\leandeclarationboxprotruded below\textheightinto the provenance footer (yMax = 734.67pt > footer_top = 734.56pton Page 1 ofgsw-security.pdf, Page 1 ofcommunication.pdf, and Page 33 ofcatalogue.pdf). Switching to\begin{minipage}[b]{\linewidth}places the full height in\ht\leandeclarationbox.render_tex_paragraphs&render_sections): Splits docstring prose on blank lines (\n\s*\n), joins source-wrapped lines within each paragraph before escaping inline formatting, emits preceding paragraphs above\begin{leandeclaration}, and attaches the complete final explanatory paragraph to short following declarations (< 0.35\textheight). Long declarations (>= 0.35\textheight) remain breakable while avoiding orphaned or mid-paragraph split explanations at the bottom of a page (\ifdim\pagetotal>0.80\textheight\newpage\fi+{\interlinepenalty=10000\BODY\par}).page_drawn_bounds&build_pdf): Setsbottom=1.1in,footskip=44ptwith\widowpenalty=10000and\clubpenalty=10000, extracts vector path bounding boxes from each page's PDF content stream inpage_drawn_bounds, and enforces>= 12ptclearance above the provenance footer (footer_top - y_max >= 12) for both body text and drawnleanboxborders.Validation & Artifact Evidence
./scripts/check.shgates (lake build --wfail --iofail,lake exe mk_all --check,lake test --wfail --iofail,lake lint,lake exe lint-style,lake exe checkInitImports),python3 -B scripts/check_hygiene.py,python3 -B scripts/build_abstracts.py --check, and all 75 unit and TeX/Poppler integration tests inscripts/test_*.pypass (0skipped).1334176d81b3e27326b28ed87161f25906dd69a1(tree83ae934ce8dca798a68e689b56b83ecc10af22c8,source_dirty: false) pass all margin and footer-clearance checks across all 14 catalogue abstracts (min_text_clear >= 14.19pt,min_box_clear >= 17.34pt), the 41-pagecatalogue.pdf(b9cb6e3eace50e94fe95bce52ca690d56ce90a8509b086dd12f380c17ea25cc2), and the 6-pagegsw-security.pdfregression fixture (d5d855d88cc3fd369ad2af11a16aafe15ab6c7f7ed5766c116ac06b73b1fb97c,min_text_clear = 35.76pt,min_box_clear = 27.45pt). No generated PDFs are committed.abstracts/catalogue.jsonentries changed.worker-jetski-73aa4b5a(Jetski / Gemini, session73aa4b5a-fa3d-4195-8024-b19f43bfa557). Independent code and page-by-page visual review of all 25 rendered pages acrossgsw-security.pdf(6 pages),communication.pdf(2 pages),cook-levin.pdf(5 pages),cryptography.pdf(7 pages), andpcp.pdf(5 pages) at commit1334176d81b3e27326b28ed87161f25906dd69a1by non-authoring reviewer subagent65922026-e5f4-4d9d-830a-78dbd75e3336: APPROVE with no remaining findings.