I try to provide a specialized frame in beamer using columns. The code is below:
\documentclass[mathserif]{beamer}
\newenvironment{questionframe}[1]{
\begin{frame}{#1}\begin{columns}[t]
}{
\end{columns}\end{frame}
}
\newenvironment{question}
{\begin{column}{0.5\textwidth}}
{\end{column}}
\newenvironment{answer}
{\begin{column}{0.5\textwidth}}
{\end{column}}
\begin{document}
\begin{questionframe}{Question frame, very long, very long}
\begin{question}
This is a question!
\end{question}
\begin{answer}
This is the answer!
\end{answer}
\end{questionframe}
\end{document}
I get the following error:
! File ended while scanning use of \beamer@collect@@body.
Yet, if I move the "columns" environment out of questionframe environment definitionstraight forward to the question in the document, the compilation is ok...
Could someone explain me the problem? Anyway to prevent this?
Any hint will be welcome.
\newenvironment{questionframe}[1]{ \begin{frame}{#1}\columns[t] }{\endcolumns \end{frame} }
\newenvironment{foo}
actually defines\foo
and\endfoo
...