4

I have read these two posts with attention but.. still, there are things I would like to do with beamer overlay specifications that seem not straightforward.

In a nutshell, I need to mix absolute with relative overlays with a real concern for factorisation, lisibility and flexibility. Like "another way to think about overlay".

Here is the hardcoded version of the example I would like to refactor:

my \alert<1>{frame}: \hfill \visible<7>{cuckoo!}
\begin{itemize}
    \item<2-> on the \alert<2>{second} slide
    \item<3-> on the \alert<3>{third} slide
    \item<4-> on the \alert<4>{fourth} then the \alert<5>{fifth} slides
    \item<6-> on the \alert<6-7>{sixth} slide
    \item<8-> on the \alert<8>{eighth} slide
\end{itemize}
\visible<9->{but keep it \alert<9-10>{flexible!}}
\visible<10-11>{.. please :'(}

Here is how I would like to rewrite it:

% sweet dream: `*`     would mean "after the previous one, increase counter"
%              `|`     would mean "same as the previous one, counter safe"
%              `*(2)`  would add ".. during two slides, increase counter"
%              `|(2)`  would add ".. during two slides, counter safe"
%              `|(+1)` would mean "one after the previous one, counter safe"
%              `*(+2)` would mean "two after the previous one, increase counter"
%              `(7)*`  would mean "one after the absolute seventh one, increase counter"

my \alert<1>{frame}: \hfill \visible<7>{cuckoo!}                            % counter: 1
\begin{itemize}
    \item<*-> on the \alert<|>{second} slide                                % counter: 2
    \item<*-> on the \alert<|>{third} slide                                 % counter: 3
    \item<*-> on the \alert<|>{fourth} then the \alert<|(+1)>{fifth} slides % counter: 4
    \item<*(+2)-> on the \alert<|(2)>{sixth} slide                          % counter: 6
    \item<(7)*-> on the \alert<|>{eighth} slide                             % counter: 8
\end{itemize}
\visible<*->{but keep it \alert<|(2)>{flexible!}}                           % counter: 9
\visible<*(2)>{.. please :'(}                                               % counter: 10

% the absolute `7` would be factorized away with `\def\anchor{7}`

.. of course, such * and | overlay operators do not exist as far as I know. I have been screwing around with +, ., +(1), .(1), \stepcounter etc. with no success (mostly falling into endless compilation loops).

What is the closest I could get from this alternative, oniric overlay language?


doing it myself?

I am aware this would imply that my code is read linearly, which may not be the way beamer actually works.

I think it would not be difficult to write parametrized commands and a dedicated counter, which would expand down to the actual absolute overlays I need (i.e. expand to hardcoded example above). But how to make them not evaluated multiple times during successive slides compilation?

Once they would've been written, how to get into overlay syntax so that \alert<\sameAsPreviousOneCounterSafeAdd{2}>{sixth} would be expanded from \alert<|(2)>{sixth}? LaTeX needs sugar.

5

Perhaps I miss something, but the spec in your 'dream' seems to be simply

\documentclass{beamer}
\begin{document}

\begin{frame}
my \alert<+>{frame}: \hfill \visible<7>{cuckoo!} % Might use <.(6)>
\begin{itemize}[<+->]
    \item on the \alert<.>{second} slide
    \item on the \alert<.>{third} slide
    \item on the \alert<.>{fourth} then the \alert<+>{fifth} slides
    \item on the \alert<.-+>{sixth} slide
    \item on the \alert<.>{eighth} slide
\end{itemize}
\visible<+->{but keep it \alert<.-+>{flexible!}}
\visible<.-+>{.. please :'(}
\end{frame}

\end{document}

As has been covered in other posts, the key to remember is that every time a + is encountered, it increases the beamerpauses counter by 1. Note that you can set this by hand if you wish (\secounter{beamerpauses}{<some-value>}), though in most cases this will lead to more not less complexity.

| improve this answer | |
  • .. well this is embarassing. I seem to have definitely missed something. This works just as in my dreams Ô.Ô Thank you and forgive my mixed-up brain today. – iago-lito 'considering leaving Jan 16 '17 at 13:08
5

very similar to Joseph Wrights answer, but without the automatic itemize uncovering:

\documentclass{beamer}

\begin{document}

    \begin{frame}
        my \alert<+>{frame}: \hfill \visible<7>{cuckoo!}
        \begin{itemize}
            \item<+-> on the \alert<.>{second} slide
            \item<+-> on the \alert<.>{third} slide
            \item<+-> on the \alert<.>{fourth} then the \alert<+>{fifth} slides
            \item<+-> on the \alert<.,+>{sixth} slide
            \item<.(-1)-> on the \alert<+>{eighth} slide
        \end{itemize}
        \visible<+->{but keep it \alert<.,+>{flexible!}}
        \visible<.>{.. please :'(}
    \end{frame}

\end{document}
| improve this answer | |
  • Yeah. I guess everything was there already without me being able to enjoy it XD Cheers and sorry for this mix-up! – iago-lito 'considering leaving Jan 16 '17 at 13:10

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.