1

For the classes I teach, I will sometimes put some fill-in-the-blank questions on a slide for students to answer using \alt (default text = blank, alternative = answer). The issue I am having is that in handout mode, I cannot figure out how to have one handout slide with the default text and another one with the alternative. If I do not specify, only the default text is shown. I can add a specification for handout mode (|handout:0) to force the alternative, but then I only have one slide with the alternative. I want both so that one slide has just the questions and the next slide has the answers. For example, this will have one handout slide with just the answers:

\begin{enumerate}
\item The sky is \alt<-1|handout:0>{$\rule{1cm}{0.15mm}$}{blue}.

\item The grass is \alt<-2|handout:0>{$\rule{1cm}{0.15mm}$}{green}.

\end{enumerate}

I prefer using \alt, rather than \only, as it's more compact for what I'm doing. Is there a way to do this while still using \alt?

Side note: To actually show both the question and answer, I have to add the following to the end of the frame because \alt does not seem to force the creation of additional slides, unlike \only:

\only<3->{ }

Edit:

Here's a minimal working example. I think the fundamental issue is that I don't know of a way to specify separately on which handout slide the default and alternative texts should appear, as \alt doesn't seem to have a way to specify that.

\documentclass[handout,t]{beamer}

\begin{document}

\begin{frame}
\frametitle{Test Slide}

\begin{enumerate}
\item The sky is \alt<-1|handout:0>{$\rule{1cm}{0.15mm}$}{blue}.

\item The grass is \alt<-2|handout:0>{$\rule{1cm}{0.15mm}$}{green}.

\end{enumerate}

\only<3->{ }

\end{frame}

\end{document}
1
  • By default, handout mode collapses everything on to one slide per frame. To force it to produce more than one slide per frame, put <handout:1-2> (or whatever) as an overlay specification on the frame, as in \begin{frame}<handout:1-2>. Then use the specifications <handout:1> and <handout:2> to control what is on each one. Without a compilable MWE I can't show a full example for you, but that's the principle behind it. Jan 31, 2020 at 23:13

1 Answer 1

2

This is an expansion on my comment, using your MWE.

Here's the code:

\documentclass[handout,t]{beamer}
%\url{https://tex.stackexchange.com/q/526479/86}

\begin{document}

\begin{frame}<handout:1-2>
\frametitle{Test Slide}

\begin{enumerate}
\item The sky is \alt<-1|handout:1>{$\rule{1cm}{0.15mm}$}{blue}.

\item The grass is \alt<-2|handout:1>{$\rule{1cm}{0.15mm}$}{green}.

\end{enumerate}

\only<3->{ }

\end{frame}

\end{document}

Within the document, we use the overlay specification handout:1 to say "here's something that should be on the 1st slide in the handout version". Normally, all overlay specifications are collapsed in handout mode, but any that are prefixed with handout are taken to mean "No really, I do want more than one slide in the handout version of this frame.". So as beamer goes through this frame, it sees the handout:1 and realises that you are being specific about what goes on what slide in handout mode and creates enough separate handout slides.

But it only creates enough for what is actually specified. Because you're using \alt (which is fine!), you say "This on handout slide 1, and That on everything else.". But beamer is perfectly happy for "Everything else" to mean "Nothing more" so it doesn't create an extra slide for the "Everything else" unless we tell it explicitly to do so. This is the point of the <handout:1-2> after the \begin{frame}: this tells beamer that we definitely want two slides in the handout version. So it creates two slides, one with the stuff marked handout:1 and one for "everything else".

Incidentally, I suspect that the \only<3->{ } is there to achieve the same thing with the presentation mode. If you remove that line and put <beamer:1-3|handout:1-2> after the \begin{frame} then you'll have the same result but it'll be easier later to see what's going on.

2
  • Yes, to make sure it's clear, you are correct that \only<3->{ } is there to achieve the same thing in presentation mode, so this also eliminates that odd bit of code. Thanks.
    – cs_to_cs
    Feb 6, 2020 at 21:03
  • I have no end of similar hacks in my beamer code to get the slides right. Getting the pauses right before and after lists has been something I've fought for many years. Feb 6, 2020 at 21:36

You must log in to answer this question.

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