3

In a beamer presentation I'm trying to display two different images during the same item in itemize. If I add a \pause between the items the images are not displayed.

So, how should I display the "Three, then four" item twice?

Probably this is a really stupid question but I couldn't find a solution searching on these pages or on the web.

\begin{frame} \frametitle{Title} \begin{columns} \column{.4\textwidth} \begin{minipage}[c][.6\textheight][c]{\linewidth} \begin{itemize}[<+->] \item One \item Two \item Three, then four \item Five \end{itemize} \end{minipage} \column{.6\textwidth} \center \includegraphics<1>{fig_1} \includegraphics<2>{fig_2} \includegraphics<3>{fig_3} \includegraphics<4>{fig_4} \includegraphics<5>{fig_5} \end{columns} \end{frame} 
1
  • The beamer class should be mention here also in the title and early in the body, not just in the tags, to make things clear you are not talking about the normal itemize environment. Also please always post complete, compilable, but minimal examples like Andrew Stacey did in his answer. This way people can compile it by themselves right away and check what's the trouble is. Commented Apr 14, 2011 at 7:44

2 Answers 2

2

The issue here is the fact that \pause has global scope within the frame. Putting a \pause somewhere on a slide says "Nothing after this appears on earlier slides.". This cannot be overridden. So all of your \includegraphics commands are wrapped in a "Don't show until after the slide with \pause is visible.". So you need to limit the scope of the \pause.

One way is to explicitly tell beamer which slide each item should appear on by writing something like \item<3->. Another is to exploit the behaviour of beamer when it encounters the <+-> syntax. The advantage of this second way is that it is robust under changing the order of the list, or inserting or removing items. The important thing to know is that when beamer sees a + sign in an overlay specification, such as <+->, then it increments its internal counter which keeps track of what slide stuff should appear on. So each \item<+-> says, "Display this from the next slide onwards." (note that the optional argument to the itemize environment is simply a shortcut way of saying \item<+-> each time). The trick, therefore, is to tell beamer to increment the counter at the time you want the extra pause. The item three, then four will be displayed from overlay 3 onwards, but the item five will wait an extra turn before it is displayed.

There are various ways of achieving this goal. The most direct is simply to write \stepcounter{beamerpauses}. The most indirect is to ensure that beamer sees an extra + somewhere. Indeed, this could be one for an obfuscation competition! Putting \onslide<+>{} or \alert<+>{} or \invisible<+>{}, or indeed any overlay-aware command somewhere on that line will do the trick. I think that my personal favourite would be to write

\visible<-+,+->{Three, then four} 

(Note that as the two +s occur in the same overlay specification, the counter is only updated once.) But the \stepcounter is probably the clearest, and the easiest to remember why you put it there in six months' time.

\documentclass{beamer} \begin{document} \begin{frame} \frametitle{Title} \begin{columns} \column{.4\textwidth} \begin{minipage}[c][.6\textheight][c]{\linewidth} \begin{itemize}[<+->] \item One \item Two \item Three, then four \stepcounter{beamerpauses} \item Five \end{itemize} \end{minipage} \column{.6\textwidth} \center \includegraphics<1>{fig_1} \includegraphics<2>{fig_2} \includegraphics<3>{fig_3} \includegraphics<4>{fig_4} \includegraphics<5>{fig_5} \end{columns} \end{frame} \end{document} 
3
  • mm..I think I did some confusion...I want fig_4 to replace fig_3 while on the left column the item "Three, then four" is left untouched. PS: sorry for the problem with the minimal example! Commented Apr 14, 2011 at 8:09
  • I've got it!...two correct answer..which one should I choose? Commented Apr 14, 2011 at 8:36
  • @Pietro: I'm confused. When do you want the "then four" to appear? From your comment, it seems that the "then four" should be visible at the same time as the "three," and I've changed my answer to fit this case. If you want the "then four" to appear afterwards, then my original answer is correct and I should revert it to that. Please let me know which one you want! Commented Apr 14, 2011 at 8:45
2

do not use [<+->] as a global definition for the itemize environment. Use for every item \item<1-> (example for the first one) instead, then you can have two items at the same time.

\PassOptionsToPackage{demo}{graphicx}%% delete it \documentclass{beamer} \begin{document} \begin{frame} \frametitle{Title} \begin{columns} \column{.4\textwidth} \begin{minipage}[c][.6\textheight][c]{\linewidth} \begin{itemize} \item<1-> One \item<2-> Two \item<3-> Three, \onslide<4->{then four} \item<5-> Five \end{itemize} \end{minipage} \column{.6\textwidth} \center \includegraphics<1>{fig_1} \includegraphics<2>{fig_2} \includegraphics<3>{fig_3} \includegraphics<4>{fig_4} \includegraphics<5>{fig_5} \end{columns} \end{frame} \end{document} 
2
  • I tried this code:\begin{itemize} \item<1-> Struttura cristallina \item<2-> Bande e superficie di fermi \item<4-> Densit`a degli stati \item<5-> Magnetismo \end{itemize} but doesn't work. Commented Apr 14, 2011 at 7:36
  • 1
    maybe that I misunderstood your problem, but I added my code to the answer Commented Apr 14, 2011 at 7:59

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.