1

I have read the questions on this web over this topic of relative overlay specifications in Beamer, concretely Relative Overlay Clarification, plus Beamer manual, some blog posts and what not.

And I must confess that I think I do not understand this well. For what I could see, when you write something like <+-> as an overlay command, you should expect the command or text to be rendered one slide after the previous.

But when I compile the following code, I do not observe the expected result:

\documentclass[xcolor=dvipsnames, 12pt, c]{beamer}

\begin{document}

\begin{frame}{Test} Blah, blah,\dots (First slide) \onslide<+->{¡Hola! (Should it be the second slide?)} \onslide<+->{Perhaps third? No clear\dots} \end{frame}

\end{document}

Actually, it creates a first slide with the text of the first onslide in it, ¡Hola! (Should it be the second slide?), and a second and final slice with this, and the last text, Perhaps third? No clear....

I will consider that it should produce a first slide without any text from the onslide commands, then a second slide with the first onslide text, and so on. Am I interpreting wrong the overlay specifications? I assume that, but I would like further clarification from experts.

alfeliz
  • 65
  • 8
  • 1
    As I detail in https://tex.stackexchange.com/questions/154521/relative-overlay-specification-in-beamer?noredirect=1&lq=1, + is replaced by the current counter value, then increments the counter, so the first + is always replaced by 1 unless you mess with the counter – Joseph Wright Oct 28 '22 at 07:46
  • Sorry for the delay in the answer, but I think I understand this correctly. And then I have a doubt. How could I first, render some text and later start to put onslide consecutively? – alfeliz Nov 09 '22 at 07:48

1 Answers1

0

So, I now have clear this question and I would like to put it here for future reference, because althougth the linked question says it all, it does so in a way that is not always easy to understand to me.

First of all, overlays specifications using \onslide work over all the code after the specification and until the next piece of code with overlays. This means that usually is not necessary to use them with brackets, unless you want to do really strange things.

Second, symbol + maintains the counter and then increments its value, so it renders what comes later in the previous slide, and later increments the counter for the other slides. This means that using and overlay specification like <+-> will render in the same slide its code and later add 1 to the framecounter.

Then, if there is a situation in which some previous text has been rendered and there is a need for text, or any code, in the next slide, specification must be <+(1)->. In this way frame counter is added before render the text. If more code would need to be sequentially rendered, then the overlay specification <+(1)-> must be added.

This minimal workind example shows a frame with some text in the first slide, and then sequentially other parts of it, employing relative overlays:

\documentclass[12pt]{beamer}

\begin{document}

\begin{frame}{Test frame} First slide: Blah, blah,\dots

\onslide<+(1)-> Second slide, with text \textbf{after} the first line has been rendered.

%From this line on, slides will continue because there is an "\onslide" command, like in the previous line...: \onslide<+(1)-> Third slide, because again I add 1 to the frame counter before I render it.

\onslide<+(1)-> And this the forth, for the same reson than the previous\dots

\end{frame}

\end{document}

Finally, Joseph Wright has written as a consequence of the question about overlays linked before called Relative Overlay Clarification a good long explanation of the overlays, so I linked it here for the readers interested in expand what is here written: https://tug.org/TUGboat/tb35-1/tb109wright.pdf (and my own reference).

alfeliz
  • 65
  • 8