Skip to content

Two \column's in a frame no longer cost a page break - #215

Merged
tannevaled merged 1 commit into
mainfrom
cols-plus-verb
Sep 4, 2026
Merged

Two \column's in a frame no longer cost a page break#215
tannevaled merged 1 commit into
mainfrom
cols-plus-verb

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

\beamer@colclose is not just an \end{minipage}:

\def\beamer@colclose{\end{minipage}\hfill\end{actionenv}\ignorespaces}
                                       (beamerbaseframecomponents.sty:283)

A body scanner that meets the next \column has honoured only its first half — the
\end{minipage} — but emptied the whole macro, dropping the \end{actionenv}
that pairs with the \begin{actionenv} the column opened. Two columns then left an
environment group open, the \end{frame} that followed closed that instead of
the frame, and the next frame never began its own page. With material after
\end{columns} the pages even came out in the wrong order — the text following the
columns landed on the page before the frame's own content.

Now only the honoured half is dropped.

Why this took two goes

The first attempt at this (branch beamer-colclose, measured in #205) looked like a
regression: it fixed the synthetic cases and one real talk while breaking another,
039a234b02c5, whose first column holds an lstlisting. That talk was not a
counter-example to the fix — it was #214: the listing was reading its body from the
character buffer and eating the column. With #214 merged, the two compose.

Measured against tectonic

before after
beamer page error (79 talks) 40 38
exact 62 63
0029f300 5 pages 7 (reference 7)
039a234b02c5 4 pages, 1307 glyphs 4 pages, 1493 glyphs
arXiv (157 papers) 583 583

Tests

colCloseAfterEndMinipage is unit-tested — the tail kept, a closer with no leading
\end{minipage} left alone, an empty one left empty. The whole-document test needs
the real beamer class (the built-in emulation makes \column a \par and never
opens an actionenv, so it cannot show the defect); it skips with a stated reason
where the tree is absent rather than passing for the wrong one.

Closes #205.

🤖 Generated with Claude Code

beamer's \beamer@colclose is not just an \end{minipage}:

	\def\beamer@colclose{\end{minipage}\hfill\end{actionenv}\ignorespaces}
	                                            (beamerbaseframecomponents.sty:283)

A body scanner that meets the next \column has honoured only its first half — the
\end{minipage} — but emptied the WHOLE macro, dropping the \end{actionenv} that
pairs with the \begin{actionenv} the column opened. Two columns then left an
environment group open, the \end{frame} that followed closed THAT instead of the
frame, and the next frame never began its own page. With material after
\end{columns} the pages even came out in the wrong order: the text that followed
the columns on the page BEFORE the frame's own content.

So only the honoured half is dropped now. This needed #214 first: the talk that
made the naive version look like a regression has an lstlisting in its first
column, and the listing was eating the column.

Measured against tectonic, with #214 in: beamer page error 40 → 38 over 79 talks,
62 → 63 exact — 0029f300 goes 5 → 7 pages against a reference of 7, and
039a234b02c5 keeps its 4 pages while drawing 1307 → 1493 glyphs. arXiv unchanged
at 583 over 157 papers.

Closes #205.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit 5990c5a into main Sep 4, 2026
18 checks passed
@tannevaled
tannevaled deleted the cols-plus-verb branch September 4, 2026 09:27
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.

Two \column's in a beamer frame swallow a page break, and can reorder the pages

1 participant