josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.43k stars 145 forks source link

Crash if `\end{frame}` of a fragile frame has a non-space trailing character #636

Closed e-kwsm closed 4 years ago

e-kwsm commented 4 years ago

MWE:

\documentclass{beamer}
\begin{document}
\begin{frame}[fragile]
\end{frame} %
\end{document}
%\end{frame} \end{document}  % this also causes error
$ pdflatex mwe.tex
…
(/opt/texlive/2020/texmf-dist/tex/latex/translator/translator-theorem-dictionar
y-English.dict)
No file mwe.nav.
)
Runaway argument?
! File ended while scanning use of \next.
<inserted text> 
                \par 
<*> mwe.tex

? 
samcarter commented 4 years ago

For fragile frames \end{frame} must stand alone, that's by design

To quote the beamer user guide:

To determine the end of the frame, the following rule is used: The first occurrence of a single line containing exactly \end{⟨frame environment name⟩} ends the frame. The ⟨environment name⟩ is normally frame, but it can be changed using the environment option. This special rule is needed since the frame contents is, after all, not interpreted when it is gathered.

(emphasis mine)

e-kwsm commented 4 years ago

Thanks, I didn't notice it.