Skip to content

engine: a column's \end{minipage} arrives through \column and \end{columns} - #176

Merged
tannevaled merged 1 commit into
mainfrom
column-closes-minipage
Aug 31, 2026
Merged

engine: a column's \end{minipage} arrives through \column and \end{columns}#176
tannevaled merged 1 commit into
mainfrom
column-closes-minipage

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

beamer opens a column's minipage and defers its \end into \beamer@colclose:

\newcommand<>\beamer@columncom[2][\beamer@colmode]{%
  \beamer@colclose
  \def\beamer@colclose{\end{minipage}\hfill\end{actionenv}\ignorespaces}%
  \begin{actionenv}#3…\begin{minipage}…}
                          % beamerbaseframecomponents.sty:281-283

so the \end this scan hunts arrives through the next \column, or through \end{columns} (:237 — \endcolumns begins with \beamer@colclose). A raw scan sees neither: \column takes arguments where the narrow expandsToEnd rule only reaches parameterless macros, and \end{columns} is stored as somebody else's \end.

Read raw, the first column swallowed its sibling and everything after the frame. A talk with two columns in a [fragile] frame rendered one page of its seven. Issue #127 found this; #129 caught only the case where the frame's own file ends there, which is why it came back.

Both are now read as what they are:

  • at \column, the body ends and \beamer@colclose is emptied — its \end{minipage} has just been honoured, which is what beamer itself does after running it (:269, \beamer@colclose\def\beamer@colclose{});
  • at \end{columns}, \end<columns>'s body is pushed so \beamer@colclose, and then its \end{minipage}, surface for the depth bookkeeping.

Measured — 200 beamer talks, 200 arXiv papers

5 talks change, two closer to tectonic and none further:

avant après tectonic
1 5 7
2 4 4

beamer gains +2885 glyphs and its page error against the 80 tectonic renders falls 48 → 42, with one more exact match (62/80). arXiv does not move by one glyph.

Test

columnclosesminipage_test.go: two columns in a [fragile] frame, with a frame on either side — three pages, and the last frame's text must be on the page. On main it is one page carrying only the first frame.

…lumns}

beamer opens a column's minipage and defers its \end into \beamer@colclose
(beamerbaseframecomponents.sty:281-283):

	\newcommand<>\beamer@columncom[2][\beamer@colmode]{%
	  \beamer@colclose
	  \def\beamer@colclose{\end{minipage}\hfill\end{actionenv}\ignorespaces}%
	  \begin{actionenv}#3…\begin{minipage}…}

so the \end this scan hunts arrives through the NEXT \column, or through
\end{columns} (:237, \endcolumns begins with \beamer@colclose). A raw scan sees
neither: \column takes arguments where the narrow expandsToEnd rule only reaches
parameterless macros, and \end{columns} is stored as somebody else's \end.

Read raw, the first column swallowed its sibling and everything after the frame. A
talk with two columns in a [fragile] frame rendered ONE page of its seven; issue #127
found this and #129 caught only the case where the frame's own file ends there.

Both are now read as what they are: at \column the body ends and \beamer@colclose is
emptied, its \end{minipage} having just been honoured (which is what beamer itself
does after running it, :269); at \end{columns} the \end<columns> body is pushed so
\beamer@colclose, and then its \end{minipage}, surface for the depth bookkeeping.

Measured over 200 beamer talks and 200 arXiv papers: 5 talks change, two of them
moving CLOSER to tectonic and none further — one 1 -> 5 pages (tectonic 7, +2268
glyphs), one 2 -> 4, exactly tectonic's. beamer gains 2885 glyphs and its page error
against the 80 tectonic renders falls 48 -> 42, with one more exact match. arXiv does
not move by one glyph.
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