3

I've got a problem in beamer. When using the fragile option on a frame, the compilation does not work. For instance:

\documentclass{beamer}

\begin{document}
  \begin{frame}[fragile]

      Hello World

  \end{frame}

\end{document}

I get the following error message:

File ended while scanning use of \next

Do you know why ? I tried with miktex and Texlive, on windows and Mac. Many thanks for your help, Best, Nicolas

David Carlisle
  • 757,742

1 Answers1

6

\end{frame} must start at the beginning of the line. You have

\begin{document}
    \begin{frame}[fragile]

        Hello World

    \end{frame}

\end{document}

use

\begin{document}
\begin{frame}[fragile]

        Hello World

\end{frame}

\end{document}
  • good catch I'll adjust the formatting in the question to put that back (+1) – David Carlisle Nov 11 '15 at 20:58
  • 2
    Why do we need the \end{frame} to be at the beginning of the line ? – Nicolas Debarsy Nov 11 '15 at 21:09
  • beamer must collect the contents of a frame before it will be typeset. And the end of the contents is reached if the current line is \end{frame}, without additional characters before and after –  Nov 11 '15 at 21:22
  • What a disarming answer... So, is this beamers' fault? – Enlico Oct 31 '16 at 11:36
  • @EnricoMariaDeAngelis: It's no fault, it is the syntax of the environment –  Oct 31 '16 at 18:46
  • Let's call it in another way than "fault", but it's surely not a "happy thing". I mean, it forces one to ruin a nice indentation. – Enlico Oct 31 '16 at 19:05