Skip to content

class-geometry: KOMA-Script classes default to A4 (#842, part 1 of 2) - #847

Closed
d-q222 wants to merge 1 commit into
mainfrom
muse/koma-typearea
Closed

d-q222 wants to merge 1 commit into
mainfrom
muse/koma-typearea

Conversation

@d-q222

@d-q222 d-q222 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

First half of #842. KOMA-Script classes rendered on the wrong paper.

KOMA defaults to A4 and sets pdfTeX's \pdfpagewidth/\pdfpageheight, so the output PDF really is A4. FlashTeX emitted US Letter.

Verified independently by the Commander (freshly built CLI, pdfinfo)

case pdflatex FlashTeX
\documentclass{scrartcl} 595.276 × 841.89 595.276 × 841.89 ✅ fixed
\documentclass{article} 612 × 792 612 × 792 ✅ unchanged
\documentclass[a4paper]{article} 612 × 792 612 × 792 ✅ regression control holds

That last row is the one to watch. article's a4paper option sets \paperwidth but not pdfTeX's page size, so the PDF correctly keeps the distribution default — FlashTeX already matched pdflatex there, and "fixing" it to A4 would have broken exact parity. KOMA differs precisely because it does set the pdfTeX dimensions. crates/class-geometry/tests/koma_paper.rs pins this.

Scope — this is part 1 of 2, deliberately

The type area is not fixed yet. Measured: scrartcl page-2 text band went 538.0 → 628.0 pt against the oracle's ~630–640 pt. The remaining ~12 pt is KOMA's typearea computation, which is a separate slice. Page size was the smaller, higher-confidence half and is worth landing on its own.

Tests

crates/class-geometry: 20 passed / 0 failed (2 unit + 9 koma_paper + 7 letter_oracle + 2 oracle). crates/compiler (untouched): 459 passed / 0 failed.

The lane was explicit about what it did not check: visual inspection of output PDFs, the page-builder crate (untouched), and the 5 corpus documents that use evan.sty/scrbook. Those remain for the type-area slice.

Oracle: /Library/TeX/texbin/pdflatex, pdfTeX 1.40.29, TeX Live 2026; 40-paragraph filler, no packages loaded.

⚠️ Lands in crates/class-geometry. Confirm whether this reaches the renderer directly or needs the vendor re-pin before closing #842.

Implemented by a sandboxed Muse lane — the first to commit on its own after the lane harness was switched from git worktrees to in-sandbox clones. Reviewed and published by the Commander.

🤖 Generated with Claude Code

…owing paper

scrartcl/scrreprt/scrbook parsed as new ClassKind variants (A4 default,
11pt default, scrbook twoside/openright) instead of falling back to
article+Empty pagestyle. resolve() uses paper media for KOMA, matching
pdflatex which sets \pdfpagewidth/\pdfpageheight via typearea.
KOMA paper=/fontsize= options honoured in source order (probed);
DIV=/BCOR= stay unused. Pins [a4paper]{article} staying Letter.

Issue #842 (paper-size half; typearea still pending).

Implementation-Agent: muse-spark-1.3-contributor
Commit-Executor: muse-spark-1.3-contributor
@d-q222

d-q222 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #858. Closing rather than merging, and the reasoning is worth recording.

#858 (muse/koma-typearea2) is a superset of this PR: it does the paper size and the typearea DIV computation that this one explicitly deferred as "part 2 of 2". Because that lane branched from main before this PR merged and reimplemented the same area more completely, the two conflict in four files — class.rs, lib.rs, pagestyle.rs, sections.rs. Merging both would mean hand-resolving a 1,114-line change against a 329-line one, in exactly the region where a bad resolution is hardest to spot.

Everything this PR established is carried over and still verified in #858:

  • scrartcl emits A4, matching pdflatex.
  • The [a4paper]{article} regression control still holds at 612 × 792 letter. That was the valuable part of this PR — the near-miss where "fixing" FlashTeX to emit A4 would have broken exact parity, since article's a4paper sets \paperwidth but not pdfTeX's page size.
  • \documentclass{article} band unchanged.

The type area went from 538.0 pt → 628.0 pt here, and 628.0 → 645.50 pt in #858 against an oracle of 639.72 pt, with the remaining 5.78 pt proven to be a font-box artifact rather than geometry (identical 637.56 pt ink band at 200 dpi, identical first/last ink rows).

No work is lost. Closing as superseded.

@d-q222 d-q222 closed this Sep 18, 2026
d-q222 added a commit that referenced this pull request Sep 18, 2026
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