josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.35k stars 139 forks source link

RFE : uncover in article mode #841

Closed ysalmon closed 1 year ago

ysalmon commented 1 year ago

Greetings,

I am sorry to restate my old closed RFE #498 from 2018, but creating course material seems a non-exotic use-case for beamer.

This involves using \uncover not just for a mere presentation effect, but also as a pedagogical tool, to let students think for a while about some example or part of a proof. Using it like \uncover<handout:0|+(1)->{solution} works with handout mode.

However, it is better to distribute a written article-like document rather than a handout of the transparencies :

But the problem is, \uncover<article:0|+(1)->{solution} behaves nonsensically, by doing nothing effective.

Over the last few years, I have been using a \placehold command that does hide text in article mode (while), and a corresponding placeholdenv.

But even this seems insufficient to easily hide an enumeration :

The following does not hide the items in article mode, but that was to be expected.

\begin{frame}
\begin{description}[<article:0|+(1)->]
\item[préfixe] $\mathord\to\mathord\land pq\mathord\lor rs$
\item[suffixe] $pq\mathord\land rs\mathord\lor\mathord\to$
\item[infixe] $(p\land q)\to(r\lor s)$
\end{description}
\end{frame}

However, even though by placeholdenv does hide its content in article mode, the following does not :

\begin{frame}
\begin{description}[<placehold@+(1)->]
\item[préfixe] $\mathord\to\mathord\land pq\mathord\lor rs$
\item[suffixe] $pq\mathord\land rs\mathord\lor\mathord\to$
\item[infixe] $(p\land q)\to(r\lor s)$
\end{description}
\end{frame}

And neither does [article:placehold@.-|+(1)->]. The latter is especially frustrating because [<handout:placehold@.-|+(1)->] does hide things in handouts, and the definition of placeholdenv is exactly the same in article and handout :

\mode
<article|handout>
\NewDocumentEnvironment{placeholdenv}{D<>{.-}}{\pgfsys@begininvisible}{\pgfsys@endinvisible}

\mode
<beamer|trans|second>
\NewDocumentEnvironment{placeholdenv}{D<>{.-}}{\begin{altenv}<#1>{}{}{\pgfsys@begininvisible}{\pgfsys@endinvisible}}{\end{altenv}}

There is probably some subtlety about modes, actions and specifications that I do not get (but should it be so subtle to do something so simple ?).

There really should be an option in beamerarticle to let the different content-hiding specifications that work in handout mode work in the same way in article mode. Of course, this option would require pgf, but any person using beamer for presentations has it anyway.

samcarter commented 1 year ago

Beamer makes a ton of modifications to the itemize/enumerate/description environments to make them overlay and action aware. It only does this in the presentation modes (beamer, handout, second, trans).

In article mode, you still have the "normal" version of the list environments (modulo a bit of parsing to remove overlays/actions so they don't cause errors with the normal list environments).

This means that "just" loading pgf and enabling \uncover in article mode would not solve your problem. You would need to significantly change how lists work in beamerarticle - with all their disadvantages and incompatibilities with frequently used packages.

samcarter commented 1 year ago

Instead of trying to use beamer actions for lists in article mode, I would wrap the actual text of each item into your placehold environment.

You could automate this with the getitems package.