Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

! File ended while scanning use of \@xverbatim error starting with commit 0c387de #360

Open
dbitouze opened this issue Jan 12, 2017 · 10 comments
Assignees
Labels
enhancement New feature or request

Comments

@dbitouze
Copy link

The following M(n)WE:

\documentclass{beamer}
\begin{document}
\begin{frame}[fragile]
  \frametitle{Beamer's tutorial}
  \framesubtitle{Code for frames}
  Here is how you create a frame with Beamer class:\pause{}
\begin{verbatim}
  \begin{frame}

  \end{frame}
\end{verbatim}
\end{frame}
\end{document}

used to work nicely until commit 6a23fce and fails starting with commit 0c387de with error:

./test.vrb
)
Runaway argument?
^^M  \begin{frame}^^M^^M
! File ended while scanning use of \@xverbatim.
<inserted text> 
                \par 
l.13   \end{frame}
@josephwright josephwright self-assigned this Jan 12, 2017
@josephwright josephwright added the bug Something isn't working label Jan 12, 2017
@josephwright
Copy link
Owner

I think this is probably 'to be expected'! I've got two competing issues:

  • People who want to be able to indent \end{frame}
  • People who are documenting how to make beamer slides

To allow the former to work, you have to 'lift' the restriction that fragile frames search for only \end{frame} with no leading whitespace. On the other hand, that necessarily causes some (solvable) issues for the latter group. It's easy to think of users as mainly writing code examples, but of course that's not the case: most users are not writing about the class itself. (See #326 for more on this, and earlier see #310).

For the case where one is documenting beamer itself, one can create an alternative environment such as slide:

\documentclass{beamer}
\newenvironment{slide}
{\begin{frame}[fragile,environment=slide]}
{\end{frame}}
\begin{document}
\begin{slide}
  \frametitle{Beamer's tutorial}
  \framesubtitle{Code for frames}
  Here is how you create a frame with Beamer class:\pause{}
\begin{verbatim}
\begin{frame}

\end{frame}
\end{verbatim}
\end{slide}
\end{document}

@josephwright
Copy link
Owner

I guess I could arrange to 'count up' the nesting of frame environments, which would solve this issue but would be vulnerable still to e.g.

\documentclass{beamer}
\begin{document}
\begin{frame}[fragile]
  \frametitle{Beamer's tutorial}
  \framesubtitle{Code for frames}
  Here is how you create a frame with Beamer class:\pause{}
\begin{verbatim}
  \end{frame}
\end{verbatim}
\end{frame}
\end{document}

@FrankMittelbach
Copy link

FrankMittelbach commented Jan 12, 2017 via email

@josephwright
Copy link
Owner

Yes, something in the docs is likely appropriate.

@josephwright
Copy link
Owner

BTW, nice to know someone is testing the code (other than me, of course).

@dbitouze
Copy link
Author

So better document that beamer can document itself (on frame environments) using verbatim in order to make life easier for real uses but that you have to use, say semiverbatim in that case.

OK, agree. But, tell more than just "semiverbatim", otherwise some folks would be puzzled :)

@dbitouze
Copy link
Author

BTW, nice to know someone is testing the code (other than me, of course).

You're welcome :)

@dbitouze
Copy link
Author

AFAICS, the drawback of environments defined by \newenvironment<>{slide}[1][]{\begin{frame}[fragile,environment=slide]}{\end{frame}} is that they can not be resumed with \againframe:

\documentclass{beamer}
\newenvironment<>{slide}[1][]{\begin{frame}[fragile,environment=slide]}{\end{frame}}
\begin{document}
\begin{slide}[label=foo]
Foo
\end{slide}
%
\againframe{foo}
\end{document}

@josephwright josephwright added enhancement New feature or request and removed bug Something isn't working labels Jan 13, 2017
@josephwright
Copy link
Owner

I'm reopening here so there is an issue to remind me to do the documentation. I'll cover a few options: semiverbatim for example will happily allow againframe.

@josephwright josephwright reopened this Jan 13, 2017
@samcarter
Copy link
Collaborator

samcarter commented Oct 14, 2020

@dbitouze

AFAICS, the drawback of environments defined by \newenvironment<>{slide}[1][]{\begin{frame}[fragile,environment=slide]}{\end{frame}} is that they can not be resumed with \againframe

This works if you actually pass the optional argument on to the frame:

\documentclass{beamer}
\newenvironment<>{slide}[1][]{\begin{frame}[fragile,environment=slide,#1]}{\end{frame}}
\begin{document}
\begin{slide}[label=foo]
Foo
\end{slide}
%
\againframe{foo}
\end{document}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants