3

I searched and could not find an easy non-labour intensive solution to this one.

In making a Beamer presentation, I have some framed minipages with various arbitrary content I am transferring from a document to slides. I have some long minipages I'd like to be split such that they span across two or more single-column slides (preserving the frame box). I, of course could split up the minipages manually to smaller ones or play with fonts in some cases such that they fit into slides, but it's a tedious process. I'd rather automate, like Beamer allows with allowframebreaks+listings for automatic multi-slide content, but for minipages instead.

MWE

\documentclass{beamer}
  \mode<presentation>
\usepackage{lipsum}
\begin{document}

\begin{frame}[allowframebreaks,fragile]
\frametitle{Need to span the minipage across slides}
\begin{itemize}
   \item Sometimes
   \item need to
   \item span the
   \item minipage across
   \item multiple slides.
\end{itemize}
\fbox{\begin{minipage}[b]{.95\textwidth}%
\small
\lipsum[1-5]
\normalsize
\end{minipage}}
\end{frame}
\end{document}
  • 1
    For what it's worth, I've spent some time (for now mostly unsuccessfully) trying to adapt answers presented here and here to fit my needs. I will spend some more time tinkering with those suggestions when I have more time and if I get it to work before someone posts an answer, I will post mine. – Serguei Sep 1 '13 at 21:47
  • I just found tex.stackexchange.com/questions/13506/… recommending mdframed, which works nice for usual pages - but I tried it with your example, and it won't work with beamer (as mdframed does detection if it is in a box, and if so, it doesn't split and outputs just a single box anyway) – sdaau Feb 16 '14 at 11:47
2

This is not possible with the minipage environment: it is an unbreakable box by its very nature.

Other solutions include mdframed and tcolorbox environments, but unfortunately the page-breaking capabilities of each of these are defeated by beamer and its allowframebreaks option.

But I'd like to suggest that you avoid the allowframebreaks option. Quoting the beamer manual:

The use of this option is evil. In a (good) presentation you prepare each slide carefully and think twice before putting something on a certain slide rather than on some different slide. Using the allowframebreaks option invites the creation of horrible, endless presentations that resemble more a “paper projected on the wall” than a presentation. Nevertheless, the option does have its uses. Most noticeably, it can be convenient for automatically splitting bibliographies or long equations.

As mentioned in the last sentence: just about the only time I use allowframebreaks is for a reference/bibliography slide.

For a presentation, you should take the time to find natural breaking points so that things do not run on and on. Presumably you'll also be removing large chunks of content during the process of conversion (to avoid the dreaded wall-of-text slides), so you can treat the work of finding good frame breaks as a part of that task.

\documentclass{beamer}
  \mode<presentation>
\usepackage{lipsum}

\begin{document}
\begin{frame}
\frametitle{Need to span the minipage across slides}
\begin{itemize}
   \item Sometimes
   \item need to
   \item span the
   \item minipage across
   \item multiple slides.
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{New frame I}
\fbox{\begin{minipage}[b]{.95\textwidth}%
\small
\lipsum[1]
\end{minipage}}
\end{frame}
\begin{frame}
\frametitle{New frame II}
\fbox{\begin{minipage}[b]{.95\textwidth}%
\lipsum[2]
\end{minipage}}
\end{frame}
\begin{frame}
\frametitle{New frame III}
\fbox{\begin{minipage}[b]{.95\textwidth}%
\small
\lipsum[3]
\end{minipage}}
\end{frame}
\end{document}

For contents that are close to fitting on a single frame, you can use the frame option shrink to fit them. But I only use this as an extreme last resort.

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.