Beamer: How to show images as step-by-step images
Asked Answered
N

5

62

I'm trying to make a presentation using the Beamer class. I want to show a simple list of images, one by one in one frame, just like when you use itemize<+->.

I have no problem showing the images one-by-one, but the images shifts every time I insert a new image. How do I solve this - From my perspective there must be a simple solution, without specifying the absolute placement of the images.

Nuts answered 13/1, 2011 at 17:24 Comment(4)
Would you like to show all the images in a single frame, or each image in its own frame, but aligned with the images shown before?Carder
In a single frame... So the images do not shifts as they are uncoveredNuts
You can find an entire community on the TeX StackExchange, where no TeX-related question is too small. See this question.Hagride
Thanks for the link! I didn't know that existed.Nuts
N
54

I found a solution to my problem, by using the visble-command.

EDITED:

\visible<2->{
   \textbf{Some text}
   \begin{figure}[ht]
       \includegraphics[width=5cm]{./path/to/image}
    \end{figure}
 }
Nuts answered 13/1, 2011 at 20:40 Comment(4)
visible is superior to onslide when it comes to figures, because onslide tries to transparentize a figure, but it cannot!Wieland
I think it is not needed to use \begin{figure} in most cases like this. You can just put the \includegraphics part, at least that is what I prefer. Do you intend to have numbered figures in a beamer slideshow? If yes, you are more fastidious than I :)Mesics
Nice solution, as space for figure will be taken into account in previous overlays, while it does not seem to be the case with the \includegraphics<1>{A} approach. Worth emphasising in your post?Ellen
It worked perfectly for my case: 3 images with space between each other (\hfill-IMG1-\hfill-IMG2-\hfill-IMG3-\hfill). All the other solution makes the images move.Heteronomy
U
59

You can simply specify a series of images like this:

\includegraphics<1>{A}
\includegraphics<2>{B}
\includegraphics<3>{C}

This will produce three slides with the images A to C in exactly the same position.

Unpopular answered 13/1, 2011 at 19:0 Comment(3)
I also tried this with some success, but instead of "popping up", I would rather have the content allocated on the frame from the start. This is makes the other content on the slide move, when it appears.Nuts
This one doesn't work if the images are individually wrapped in centerline. If they're all wrapped in a single centerline then it works.Tompion
Put a % at the end of each line such that the images don't move (See Subhadeep's post below)Wreckfish
N
54

I found a solution to my problem, by using the visble-command.

EDITED:

\visible<2->{
   \textbf{Some text}
   \begin{figure}[ht]
       \includegraphics[width=5cm]{./path/to/image}
    \end{figure}
 }
Nuts answered 13/1, 2011 at 20:40 Comment(4)
visible is superior to onslide when it comes to figures, because onslide tries to transparentize a figure, but it cannot!Wieland
I think it is not needed to use \begin{figure} in most cases like this. You can just put the \includegraphics part, at least that is what I prefer. Do you intend to have numbered figures in a beamer slideshow? If yes, you are more fastidious than I :)Mesics
Nice solution, as space for figure will be taken into account in previous overlays, while it does not seem to be the case with the \includegraphics<1>{A} approach. Worth emphasising in your post?Ellen
It worked perfectly for my case: 3 images with space between each other (\hfill-IMG1-\hfill-IMG2-\hfill-IMG3-\hfill). All the other solution makes the images move.Heteronomy
U
25
\includegraphics<1>{A}%
\includegraphics<2>{B}%
\includegraphics<3>{C}%

The % is important. This will keep all the images fixed.

Unspent answered 6/8, 2018 at 12:58 Comment(4)
Shouldn't this be a comment to Svante's answer?Mokpo
I found the '%' essential for keeping the images fixed; is it a beamer-specific of latex-generic feature?Bodhisattva
@Bodhisattva I suspect that this is LaTeX-wide. The percentage sign tries to get rid of an extra whitespace that would be there due to the newline character. In most situations the extra whitespace is helpful, e.g., mid-sentence line break. In this case it's a nuisance.Avaria
Isn't % supposed to start a comment? Why does it change the content here?Tholos
U
13

This is what I did:

\begin{frame}{series of images}
\begin{center}
\begin{overprint}

\only<2>{\includegraphics[scale=0.40]{image1.pdf}}
\hspace{-0.17em}\only<3>{\includegraphics[scale=0.40]{image2.pdf}}
\hspace{-0.34em}\only<4>{\includegraphics[scale=0.40]{image3.pdf}}
\hspace{-0.17em}\only<5>{\includegraphics[scale=0.40]{image4.pdf}}

\only<2-5>{\mbox{\structure{Figure:} something}}

\end{overprint}
\end{center}
\end{frame}
Uncharitable answered 12/4, 2012 at 9:39 Comment(0)
H
1

This is a sample code I used to counter the problem.

\begin{frame}{Topic 1}
Topic of the figures
\begin{figure}
\captionsetup[subfloat]{position=top,labelformat=empty}
\only<1>{\subfloat[Fig. 1]{\includegraphics{figure1.jpg}}}
\only<2>{\subfloat[Fig. 2]{\includegraphics{figure2.jpg}}}
\only<3>{\subfloat[Fig. 3]{\includegraphics{figure3.jpg}}}
\end{figure}
\end{frame}
Horaciohorae answered 15/9, 2013 at 20:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.