I want to replace a word by another one on the next slide. I know there are commands that allow to do so (say, \uncover), but they require to carefully calculate the numbers of the slides where the command is used. However, I intend to edit my presentation, which would mean that every time when the number of slides changes, I will have to edit all such comands. Are there simple ways to avoid the problem?
Asked
Active
Viewed 6,245 times
2 Answers
10
\documentclass{beamer}
\begin{document}
\begin{frame}{main title}{subtitle}
\begin{itemize}[<+->]
\item foo
\item bar \only<.>{baz}\only<+->{BAZ}
\item foobar
\end{itemize}
\end{frame}
\end{document}
<.> the current slide
<+-> the next and following slide
and without itemize
\begin{frame}{main title}{subtitle}
\only<1>{elephant}\only<2->{giraffe}
\end{frame}
-
I am sure this works, but I meant a sentence, not an itemized structure... Is it possible to adapt it to my situation, which is like the following: I want to have I see an elephant on the N-th slide, and I see a giraffe on the slides no. N+1, N+2, and so on, until the end of the frame. – IiiI Jun 15 '16 at 17:52
-
That makes no difference:
\includegraphics<.>{elephant}\includegraphics<+->{giraffe}– Jun 15 '16 at 17:54 -
I copied your code to my file, it says ! LaTeX Error: File `elephant' not found. – IiiI Jun 15 '16 at 18:02
-
I gave an example with two images which I do not have! You have to adopt it and use image names which are exist on your system. For words simply use
\only<.>{elephant}\only<+->{giraffe}– Jun 15 '16 at 18:06 -
Are you sure in \only<.>{elephant}\only<+->{giraffe} ? Elephant is not visible. – IiiI Jun 15 '16 at 18:10
-
1
Another option is to use the \alt command. This displays either a default text or an alternate text, depending on the overlay specifications (see section 9.2 of the beamer documentation).
\documentclass{beamer}
\begin{document}
\begin{frame}{main title}{subtitle}
\begin{itemize}[<+->]
\item foo
\item bar \alt<.>{baz}{BAZ}
\item foobar
\end{itemize}
\end{frame}
\end{document}
erik
- 12,673
here is \myword{} on the next slide. That way, on the prior slide, you could say\def\myword{elephant}and then, on the next slide, what would show up would behere is elephant on the next slide– Steven B. Segletes Jun 15 '16 at 16:47