1

I want to generate handouts in article style that include my beamer slides (mostly diagrams) and explanations.

For that I am now considering to use beamerarticle. I want to frame the slides using mdframed, and setting the proper beamer templates. Problems occur when using frametitles to frames using brackets as usual (second option below). I get an extra } or forgotten \endgroup error at the \end{frame}.

\documentclass[a4paper,12pt]{article}
\usepackage{beamerarticle}
%\documentclass[ignorenonframetext]{beamer}
\usepackage{tikz}
\usepackage{mdframed}

\mode<article>{
\setbeamertemplate{frame begin}{\begin{mdframed}}
\setbeamertemplate{frame end}{\end{mdframed}}
}

\begin{document}
No problem: using \verb+\frametitle+
\begin{frame}
    \frametitle{binary search tree}
        \tikz   \draw[dashed,thick] (0,0) rectangle (8,0.5) ;
\end{frame}

Error: frametitle as argument to \verb+\frame+
\begin{frame}{extended tree}
        \tikz   \draw[dashed,thick] (0,0) rectangle (8,0.5) ;
\end{frame}
\end{document}

Thanks.

2
  • 4
    Using \frametitle is the cleaner way. I always use \frametitle since even in plain beamer documents the other syntax can cause trouble.
    – user194703
    Feb 23, 2020 at 15:13
  • @Schrödinger'scat Thanks. After bringing my problems back to a minimal example I still did not know what to blame. Feb 24, 2020 at 10:35

1 Answer 1

1

I strongly suggest not to use this confounded \begin{frame}{<frametitle>} syntax. This is only around for backwards compatibility. Instead you should use the proper \frametitle{...} syntax. It is much more flexible.

If you really must use such an annoying syntax, you could work around your problem like this:

\documentclass[a4paper,12pt]{article}
\usepackage{beamerarticle}
%\documentclass[ignorenonframetext]{beamer}

\usepackage{mdframed}

\mode<article>{
\AfterEndEnvironment{frame}{\end{mdframed}}
\BeforeBeginEnvironment{frame}{\begin{mdframed}\vspace*{-\baselineskip}}
}

\begin{document}

\begin{frame}
    \frametitle{binary search tree}
    test
\end{frame}

\begin{frame}{extended tree}
     test
\end{frame}
\end{document}
1
  • Thanks. Indeed, I stopped using the "annoying syntax". Sep 25, 2022 at 15:59

You must log in to answer this question.

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