josephwright / beamer

A LaTeX class for producing presentations and slides
Other
1.41k stars 142 forks source link

\uncover<2-|alert@2> and \only<2-|alert@2> do not alert text on overlay 2 #816

Closed ysalmon closed 1 year ago

ysalmon commented 1 year ago

This is following up on a question (not by me) from 2019 on TeX.SX.

Basically,

\documentclass{beamer}

\begin{document}
\begin{frame}
toto \alert{tata}

\uncover<2-|alert@2>{titi} \uncover<3->{tutu}
\end{frame}
\end{document}

does not alert "titi" on page 2 as intended.

As I said in my answer, using \action instead of \uncover works.

I am not claiming this to be a bug in beamer, as its erratic behaviour when dealing with multiple simultaneous action specifications is understandable.

But on the other hand, this is odd from a user perspective, and also because \action<2-|alert@2>{thing}, which I understand is a shorthand for \action<uncover@2-|alert@2>{thing}, also formulates such an over-specification. So one wonders why beamer can handle one form and maybe could it handle the other, more explicit and more user-friendly one ?

Also does that mean I can replace every instance of \uncover<bla> with \action<bla> ?

samcarter commented 1 year ago

The problem aren't simultaneous actions, the problem is using actions in commands like \only, \uncover etc. which do take overlay specifications but don't take actions, they are simply not the correct command for the job.

scottkosty commented 1 year ago

I'm ignorant here, but would it make sense to give a user-friendly error (suggestion to use \action) when something like \uncover<2-|alert@2>{titi} is used?

ysalmon commented 1 year ago

I agree, this is a case where a seemingly innocuous use case involves much a deeper understanding of beamer concepts. The difference between actions and specifications makes perfect sense as explained by @samcarter (thanks !) but is, I think, a bit counterintuitive considering \item<2-|alert@2> and \begin{itemize}[<+-|alert@+>] do work, and one never uses \action in a simple usage.