Repository navigation
class-geometry: model KOMA typearea DIV (#842 complete; supersedes #847) - #858
Merged
Merged
Conversation
pdflatex (TeX Live 2026) divides the page into a DIV grid instead of the standard classes' fixed text block; implement that computation to the scaled point: the A4 default table (8/10/12), explicit DIV, DIV=calc (good line width from CM alphabet widths), DIV=classic, BCOR, twoside, mpinclude, headinclude/footinclude, the too-short-page DIV recompute, and typearea's own paper sizes (letter is 612bp x 792bp). typearea also sets the PDF media from the paper, unlike the standard classes. Issue #842, part 2. Implementation-Agent: muse-spark-1.3-contributor Commit-Executor: muse-spark-1.3-contributor
KOMA's default size is 11pt (10.95pt body), not the 10pt the standard classes assume; read fontsize= when the class is scrartcl/scrreprt/ scrbook so body metrics match the new typearea geometry. Issue #842, part 2. Implementation-Agent: muse-spark-1.3-contributor Commit-Executor: muse-spark-1.3-contributor
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.
Completes #842. This supersedes #847 (the paper-size half): it reimplements that area more fully and conflicts with it in four files, so landing one coherent change is cleaner than a conflicted merge. #847's regression controls are carried over and still pass. I'll close #847 as superseded when this lands.
What it does
crates/class-geometry: newClassKind::{Scrartcl,Scrreprt,Scrbook}(+scrarticlealias); KOMA option parsing in given order (paper=,fontsize=,DIV=,BCOR=, include flags,pagesize=false, legacyDIV12/BCOR5mm,unusedwarnings for the rest); fulltypeareaDIV computation — A4 table 8/10/12, explicit DIV,calcwith CM good-widths,classic, BCOR, twoside, mpinclude, head/footinclude, too-short-page recompute; sp-exact paper sizes; PDF media follows the class paper unlesspagesize=false.crates/compiler: KOMA classes default to 11pt body and honourfontsize=. Standard classes unchanged.The measurement, and why the acceptance bar is met by different evidence than specified
Same 40-paragraph filler, both engines, oracle pdflatex TeX Live 2026:
My acceptance criterion said "within 2 pt of the oracle band" and the raw bbox residual is 5.78 pt. The lane proved that residual is not geometry. Rasterising both at 200 dpi with
pdftoppm, the true ink band is 637.56 pt in both, with identical first and last ink rows (243 / 2013). The 5.78 pt is poppler reporting line-boxes for FlashTeX's OTF subset versus tight boxes for pdflatex's Type 1 — a font-emission artifact in crates the lane is not allowed to touch.I'm accepting that as proof: pagination, word distribution, line pitch, media and rendered ink all agree. Tightening OTF glyph boxes is a separate concern in
crates/pdf/crates/font-*, and chasing the bbox number would have meant changing font emission to satisfy a measurement tool.Regression controls (both from #847, both still green)
\documentclass[a4paper]{article}stays 612 × 792 letter — correct, becausearticle'sa4papersets\paperwidthbut not pdfTeX's page size. "Fixing" this to A4 would break exact parity.\documentclass{article}band unchanged.Tests
crates/class-geometry: 32 passed / 0 failed — 21 new KOMA tests asserting live-pdflatex\numberlengths to the sp across 30 option combinations.crates/compiler --lib: 460 passed / 0 failed.Scope honesty
Explicitly warned, not silently ignored:
fontsizeother than 10/11/12,DIV=areaset, exotic papers,headlines=/footlines=,parskip=*, and KOMA sans heading fonts. Each lands inunusedor is documented.The class-geometry work is live (
render-pipelineusespath = "../class-geometry"), so it reaches users immediately. The compiler edit sits behind the frozenvendor/compilersnapshot and needs the pending re-pin — though end-to-end pagination already matches without it.Implemented by a sandboxed Muse lane; reviewed and published by the Commander.
🤖 Generated with Claude Code