Skip to content

beamer: \column in a [fragile] frame swallows the document (a minipage whose \end is stored for later) #127

Description

@tannevaled

Six lines, real beamer.cls, and the document renders nothing:

\documentclass{beamer}
\begin{document}
\begin{frame}[fragile]{A}
\begin{columns}
\column{0.5\textwidth}
gauche
\end{columns}
\end{frame}
\begin{frame}{B}MARQUE\end{frame}
\end{document}

pages=0. Drop the [fragile] and it is 2 pages with everything on them.

Reach

It is what stands between the engine and three of the eighty talks that now have a tectonic PDF beside them — each renders 1 page against 7, 5 and 9. columns in a fragile frame is ordinary beamer.

What is known

  • The verbatim capture is correct. texput.vrb receives exactly

    \frametitle{A}
    \begin{columns}
    \column{0.5\textwidth}
    gauche
    \end{columns}
    
  • Every reconstruction of the re-entry works: the command form \frame{…columns…}, the exact shape beamer rebuilds (\frame<*>[][{,fragile=false}]{\begingroup…\endgroup}), and the same body in a normal frame. Only the real [fragile] environment fails.

  • The cause is beamer's \column, which opens an environment and stores its \end for later (beamerbaseframecomponents.sty):

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

    so \begin{minipage} is opened by \column and its \end{minipage} only runs at the NEXT \column or at \end{columns}.

  • This engine COLLECTS a minipage's body up front. Instrumented, the collector starts inside the .vrb (niveau=1, bpos=54/91) and ends at niveau=0, bpos=186/186 — it runs off the end of that file and eats the whole document behind it.

  • engine: a collected environment body that finds no \end puts back what it read #121 already restores the input when a collected body finds no \end, but only when the scan stayed on ONE input level; here it crosses one, because a fragile frame's body comes back as a file of its own.

  • Stopping the scan at the end of the file it began in was tried: the collector then stops at bpos=138 instead of 186 — better, but the document still renders 0 pages, so the swallow is not the whole story.

Bar

The six-line document renders 2 pages with gauche and MARQUE, and the three talks (0029f300…, 023ae352…, 042e4d92…) move from 1 page toward their reference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions