Skip to content

compiler: beamer frames paginate one page per slide (#841) - #855

Merged
jay3332 merged 3 commits into
mainfrom
muse/beamer-frames
Sep 19, 2026
Merged

jay3332 merged 3 commits into
mainfrom
muse/beamer-frames

Conversation

@d-q222

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

Copy link
Copy Markdown
Contributor

Fixes #841. beamer is one of the most-used document classes in academia — essentially every conference talk — and today a whole deck collapses into one page with no diagnostic at all.

Before / after, the issue's exact 12-line repro

pages text
pdflatex 3 First/Alpha p1, Second/Beta p2, Third/Gamma p3
FlashTeX before 1 all three frames run together, zero errors, zero warnings
FlashTeX after 3 matches pdflatex, zero diagnostics

The frame environment was already recognised — there was no "environment not implemented" warning — it was simply typeset as an ordinary block. Silence was the worst part: the user got a plausible PDF and no signal.

Also in this slice

  • \frametitle{...} — the body form, previously an unknown command (37 uses in a single real deck). The \begin{frame}{Title} argument form already worked.
  • \alert — renders red (1 0 0 rg).
  • [fragile] and <1> overlay specs leave no trace rather than erroring.
  • Beamer commands inventoried; supported-latex.json, coverage.md and docs/user/compiler.md regenerated.

Deliberately not attempted: \pause/\invisible overlays (185 uses each in that deck). They multiply pages and are a separate, harder slice. One page per frame is correct, honest intermediate behaviour.

Tests

New crates/compiler/tests/beamer_frames.rs, 8 passed / 0 failed — pins the exact repro at 3 pages with per-page content, both title forms, \alert's colour, the class diagnostic outside beamer, empty-title edges, and 50 frames ≥ 50 pages. Observed failing 7/8 before the fix (1-page collapse plus unknown-command errors).

Existing guards green: frame_env 7/7, supported_latex 8/8. Full crates/compiler suite: 1,058 passed / 0 failed across 86 result lines.

Oracle /Library/TeX/texbin/pdflatex, TeX Live 2026, preamble \documentclass{beamer} exactly, no packages: Output written on repro.pdf (3 pages), confirmed per-page with pdftotext -f N -l N.

Two disclosures the lane made itself

  1. ~420 changed lines, over the ~300 per-slice guideline; every piece is fix, regression test, inventory or regenerated artifact.
  2. End-to-end PDF verification was impossible pre-re-pin — no live tex-to-PDF route exists without the frozen vendor/compiler snapshot, which is currently 14 commits behind. Proof is at layout level; PDF-level proof awaits that re-pin. It also did not check the 50-frame Mathcamp deck itself, which is not in the worktree.

Base

Merged origin/main (7054ee41) into the lane before publishing. The lane branched pre-#840, so its raw diff against main would have reverted the TAB catcode fix — caught by the publish gate, which now refuses this automatically.

Implemented by a sandboxed Muse lane; reviewed and published by the Commander.

🤖 Generated with Claude Code

Under \documentclass{beamer}, \begin{frame} now emits a page break and
reads its [options]{title}{subtitle} head (plus an optional <overlay>
spec, consumed and ignored) as unnumbered headings; the body parses as
ordinary blocks to \end{frame}. \frametitle/\framesubtitle render the
slide head anywhere in a beamer body; \alert sets beamer's red alert
colour. Outside beamer, frame stays the bordered box and the three
commands diagnose naming the class (letter.cls pattern). Overlays
(\pause etc.) are deliberately untouched: one frame is one page.

Implementation-Agent: muse-spark-1.3-contributor
Commit-Executor: muse-spark-1.3-contributor
frametitle/framesubtitle/alert join BUILT_INS and TEXT_COMMANDS with a
beamer-class probe in supported_latex (letter-probe pattern); the frame
environment row records the beamer slide reading. Regenerated
supported-latex.json, docs/user/compiler.md and the Mac bundled copy via
crates/compiler/scripts/render_supported_latex.sh.

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

CI failure diagnosed, and it is a genuine product regression — please do not fix this by updating the tests.

The 16 failures are two tests, and both are telling us something real:

1. SnippetTests.testTabMovesBetweenPlaceholdersAndEscLeaves

XCTAssertEqual failed: ("$\frametitle{}") is not equal to ("$\frac{}{}")

Typing \fra and pressing Tab now expands \frametitle{} instead of \frac{}{}. \frac is one of the most-used commands in LaTeX; \frametitle is beamer-only. Every user who types \fra⇥ in a maths document now gets the wrong command.

2. CompletionTests.testBackslashTriggersCommandsAndPrefixFilters

["\\alert{...}", "\\allowdisplaybreaks[0-4]", "\\allowbreak", "\\alpha", "\\aleph"]
["beamer alert text in red; needs \\documentclass{beamer}", "amsmath page-break permission", ...]

Typing \a now offers \alert ahead of \alpha, \aleph and \allowdisplaybreaks.

Why this is a design problem, not a test problem

Adding beamer commands to the global inventory changed completion for every document, including ones that will never load beamer. The inventory's own description says "needs \documentclass{beamer}" — so the data already knows these commands are conditional, and the completion ranking is ignoring it.

Note this is not caused by anything wrong in the beamer implementation itself, which is good work. It is a consequence of a flat, global command vocabulary meeting a class-specific package for the first time. The same problem will recur with every future class-scoped package, so it is worth solving once.

Suggested fix, in preference order

  1. Gate class-specific commands on the document class. The inventory already records the dependency; completion should respect it. \alert and \frametitle should not be offered in an article.
  2. If (1) is too large for this PR: rank class-specific commands below universal ones, so \frac beats \frametitle on the \fra prefix regardless.
  3. Only then update the two tests — and they should keep asserting that \fra⇥ gives \frac, because that assertion is correct and is what caught this.

Diagnosis notes for whoever picks this up

The failures are invisible in the CI console: ci.yml:171 pipes swift test through tail -n 400, so in a 1,483-test run the failures scroll off and the log shows only "Test Suite failed" with zero error: lines. --log-failed, check annotations and the log-archive endpoint are all useless for the same reason.

The full log is uploaded as the mac-swift-test-log artifact (89 KB, 17,470 lines). Get it with:

gh run download <run-id> --repo flash-tex/flashtex -n mac-swift-test-log

They also cannot be reproduced by a plain local swift test: this machine skips 133 tests where CI skips 34, and the failing ones sit in that gap.

Same failure affects #856 and #854.

@jay3332

jay3332 commented Sep 18, 2026

Copy link
Copy Markdown
Member

Review data from mac-claude-a (an agent of mine was on #841 before I found this PR; stopped, nothing published). One gap: this PR touches nothing under crates/class-geometry, so beamer keeps article's page. Oracle values (pdflatex TeX Live 2026, \documentclass{beamer}, \number probes in sp) if you want to pin ClassKind::Beamer here or in a follow-up:

  • paper 23867907 × 17900937 sp = 12.80 × 9.60 cm → MediaBox 362.835 × 272.126 bp
  • \textwidth 20138549 sp (paper − 2 × 1 cm; 1 cm = 1864679 sp); \oddsidemargin = \evensidemargin = −2871607 (1 cm − 1 in); \topmargin −4736286 (−1 in); \headheight 0, \headsep 0, \footskip 4 pt; \textheight = paperheight − 4 pt = 17638793
  • \topskip 11 pt, \baselineskip 13.6 pt, \parindent 0, \parskip 0; body cmss10 at 10.95 pt (default 11pt); \leftmargini 2 em, \labelsep .5 em; secnumdepth 0, tocdepth 3
  • frametitle: cmss12 at 14.4 pt (\Large, not bold), x = 0.3 cm = 8.504 bp, baseline 251.069 bp on the 272.126 bp page (21.14 pt from the top); body starts at x = 1 cm = 28.346 bp and is vertically centred by default (one-line body baseline 143.9 bp)
  • aspectratio: 169 = 16.00 × 9.00 cm (29834876 × 16782118 sp), 1610 = 16 × 10 (29834876 × 18646798), 149 = 14 × 9 (26105517 × 16782118), 54 = 12.5 × 10 (23308497 × 18646798), 32 = 13.5 × 9 (25173177 × 16782118); 10pt/12pt change only topskip/baselineskip/font, never the paper.

I can take the class-geometry half as a separate PR if you'd rather keep this one to pagination — say so on #2 and I'll claim it.

jay3332 added a commit that referenced this pull request Sep 18, 2026
Visual-oracle ranking and `flashtex check` of the five beamer decks against
their MacTeX 2026 references, beamer's defaults measured with pdflatex
probes and read from beamer.cls / the base and theme .sty files, and the
tiered gap plan (page model, frame geometry, overlays, blocks/columns,
frame options and themes) with owner crates and acceptance tests as the
draft body of the tracking issue. Pages ours/ref: default 6/7, madrid 6/7,
overlays 6/14, blocks-columns 5/6, fragile 6/8. No engine change.

Implementation-Agent: Claude Code (mac-claude-a)
Commit-Executor: git via Claude Code
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Y1nAv4pEnmMYXgteBoadHn
@jay3332

jay3332 commented Sep 18, 2026

Copy link
Copy Markdown
Member

mac-claude-a: measured against a five-deck beamer corpus (PR #943, tracking #944). Frame pagination works — the 12-line repro and all five decks paginate. Corpus shows these still on this branch (fold in or leave to the T0 lane on #944, your call):

  • An empty frame, or a frame holding only \titlepage, produces no page — four of five decks come out one page short.
  • \section{Motivation} between frames is typeset as the heading "1 Motivation"; in beamer it prints nothing (it feeds the navigation/TOC).
  • \frametitle{…} is set as a bold black heading at the text margin (baseline 10.96 bp); beamer's default theme sets it [email protected], regular, rgb(.2,.2,.7), at x=8.50 bp / baseline 21.06.
  • \alert<2>{…} → syntax_error; frame options ([t], [fragile], [plain], [allowframebreaks]) ignored; \frame{…} unknown_command; \note{…} argument printed.
    Numbers and spans in docs/evidence/beamer-audit-2026-09-18T172738Z/report.md on beamer: five-deck conformance corpus with pdflatex references, and the gap audit on main+#855+#887 #943.

jay3332 added a commit that referenced this pull request Sep 18, 2026
…e gap audit (#943)

beamer: five-deck conformance corpus with pdflatex references, and the gap audit on main+#855+#887
@jay3332
jay3332 merged commit d89cc56 into main Sep 19, 2026
21 of 22 checks passed
@jay3332

jay3332 commented Sep 19, 2026

Copy link
Copy Markdown
Member

Landed on main via the beamer batch (63d4ebca) with the corpus fixes from #944 T0/T1 on top — thank you, d-q222. Closing as merged-by-batch; the commits are on main with your authorship.

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.

2 participants