[Tex/LaTex] How to clearly demarcate frame/slide content when using article class for a beamer document

articlebeamerbeamerarticle

When I use the article class with beamer, the slides are not clearly demarcated.
Rather, the slides just blend in with the document as dot points, headings, and
so on.
This is fine when I actually want to create a stand-alone document.
However, if I'm trying to create some notes to accompany a set of slides, it
would be useful to clearly indicate where a slide starts and stops.

  • What is a good strategy for clearly demarcating slide content from non-slide content using the article class with beamer?
  • For example, how could I add a box around the slide content?

Minimal example:

Here's a minimal example

\documentclass{article}   
\usepackage{beamerarticle}
\begin{document}
\begin{frame}{Frame title}
\begin{itemize}
\item A dot point
\item another dot point
\item Another dot point
\end{itemize}
\end{frame}

Some text outside the frame.   
\end{document}

Which produces the following:

enter image description here

Best Answer

There is a way to do this. When using a beamer file in article mode, there are still loads of templates in place, it's just that most of them do boring things. So there are templates frame begin and frame end which by default do nothing, but which we can use to separate out the frames.

Here's two possibilities, one with lines and one with a box. The lines are simpler; to get a box I have to use some TikZ-magic. I couldn't figure out a way to get the contents of the frame in to a \framebox but I could use the remember picture,overlay stuff from TikZ to put a coordinate at the start and end, and then draw a box (warning: the box is drawn after the frame so can't be used to put a background behind the frame).

delimited frames

And here's the code to get that:

\documentclass[border=10]{standalone}
%\url{http://tex.stackexchange.com/q/25259/86}
\usepackage{beamerarticle}
\usepackage{tikz}

\defbeamertemplate<article>{frame begin}{lined}{\par\noindent\rule{\textwidth}{1pt}\par}
\defbeamertemplate<article>{frame end}{lined}{\par\noindent\rule{\textwidth}{1pt}\par}

\newcounter{framebox}
\defbeamertemplate<article>{frame begin}{tikzed}{\par\noindent\stepcounter{framebox}\tikz[remember picture,overlay] \path (-1ex,0) coordinate (frame top \the\value{framebox});}
\defbeamertemplate<article>{frame end}{tikzed}{\hspace*{\fill}\tikz[remember picture,overlay] \draw (frame top \the\value{framebox}) rectangle (1ex,0);\par}


\mode<article>{
\setbeamertemplate{frame begin}[tikzed]
\setbeamertemplate{frame end}[tikzed]
}

\begin{document}
This is before the frames.
\begin{frame}
\frametitle{A Typical Frame}

\begin{block}{A Block}
With some contents
\end{block}

\structure{Some structure}

\begin{itemize}
\item A list provides
\item Organisation
\item To presentations
\end{itemize}
\end{frame}
This is between them.

\mode<article>{
\setbeamertemplate{frame begin}[lined]
\setbeamertemplate{frame end}[lined]
}

\begin{frame}
\frametitle{A Typical Frame}

\begin{block}{A Block}
With some contents
\end{block}

\structure{Some structure}

\begin{itemize}
\item A list provides
\item Organisation
\item To presentations
\end{itemize}
\end{frame}

This is after the whole lot.

\end{document}