1

Say that I am using my own definition for question frames, something akin to

\documentclass{beamer}
\usetheme{Malmoe}

\newcommand{\questionframe}[2]{
    \frame[c,plain]{
        \centering\huge
        \textbf{\structure{#1}}
        \par\bigskip
        #2
    }
}
\begin{document}
\questionframe{Here is the question?}{And corresponding explanation}
\end{document}

However, within \mode*, which is super useful to my environment, these frames will get ignored. From the documentation:

The text is gobbled 209 token by token until one of the following tokens is found: \mode, \frame, \againframe, \part, \section, \subsection, \appendix, \note, \begin{frame}, and \end{document} (the last two are really tokens, but they are recognized anyway

What is the easiest way to reconcile the two - i.e., forcing beamer to stop gobbling around when it meets \questionframe?

1

1 Answer 1

2

You can try this

\documentclass{beamer}
\usetheme{Malmoe}

\newcommand{\questionframe}[2]{
    \frame[c,plain]{
        \centering\huge
        \textbf{\structure{#1}}
        \par\bigskip
        #2
    }
}
%
\usepackage{etoolbox}

\makeatletter
\preto\beamer@treat{\ifx\beamer@nexttoken\questionframe\let\next=\beamer@stopoutsidemode\fi}{}{}
\makeatother
\begin{document}
\mode*

\questionframe{Here is the question?}{And corresponding explanation}

\begin{frame}
abc
\end{frame}
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .