2

I would like to define a new environment in Beamer that creates a frame containing only an itemize (and maybe some other stuff once I this basic case to work). The following

\newenvironment{itemizeframe}
{
\begin{frame}
\begin{itemize}
}
{
\end{itemize}
\end{frame}
}

called as

\begin{itemizeframe}
\item test
\end{itemizeframe}

does not compile and outputs

Runaway argument? \let \AtEndDocument \@firstofone \@enddocumenthook \@checkend {docume\ETC.

Any idea on what's happening? I am no specialist but I guess this has to do with the internal machinery of beamer.

  • See the documentation of the environment-key on page 61 of the beamer documentation. – Ulrike Fischer Nov 25 '14 at 10:16
3

This might do the trick.

\newenvironment{itemizeframe}
{
  \begin{frame}[fragile,environment=itemizeframe]
   \begin{itemize}
 }
 {
   \end{itemize}
  \end{frame}
}

Here a little explanation from the user guide:

The environment name (itemizeframe) is used to determine the end of the scanning when gathering the frame contents. Normally, the frame ends when a line reading \end{frame} is reached. However, if you use \begin{frame} inside another environment, you need to use this option. The environment option is useful only in conjunction with the fragile option.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.