# Another way to think relative overlays?

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}
\end{itemize}


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<*(+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.

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}[<+->]
\end{itemize}
\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.

• .. 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

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

\documentclass{beamer}

\begin{document}

\begin{frame}
\begin{itemize}
\end{itemize}
\end{frame}

\end{document}

• 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