6

So, I spend like few hours trying to fix my problem. I've got an image that I want to stay at the SAME position during all the slide. And on other side, I want a list of item with overlay/replacing tricks.

To do that, I used this code (by the way, the itemize with only isn't optimize at all, but I want to replace previous item, so I don't know how to do it in one line):

\documentclass[hyperref={pdfpagemode=FullScreen},xcolor=table,t]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mwe}

\begin{document}
\begin{frame}
\frametitle{Frame Title}
\begin{minipage}[c]{0.24\textwidth}
    \includegraphics[width=\textwidth]{example-image}
\end{minipage}
\hfill
\begin{minipage}[c]{0.74\textwidth}
\includegraphics<1-2>[width=\textwidth]{example-image-a}
\includegraphics<3>[width=\textwidth]{example-image-b}
\only<1>{
\begin{itemize}
    \item blablabla
\end{itemize}
}
\only<2>{
\begin{itemize}
    \item blablabla
    \item blablabla
\end{itemize}
}
\only<3>{
\begin{itemize}
    \item blablabla
\end{itemize}
}
\end{minipage}
\end{frame}
\end{document}

As you can see there, the image on the left is moving vertically. But why ? Image is moving with the item apparition... How to deal with the apparitions without moving the image ?enter image description here

9
  • I assume this is at least somewhat related to tex.stackexchange.com/q/449452/35864
    – moewe
    Sep 6 '18 at 13:51
  • To my untrained eye this but certainly the linked issue look like bugs that should be reported to the beamer maintainers. Even if many people involved frequent this site it is better to have this officially logged at github.com/josephwright/beamer/issues
    – moewe
    Sep 6 '18 at 13:53
  • @moewe To be honest, I don't think it is the same issue. The problem in the present question is simply that the height of the second minipage changes between slides which moves the common baseline. The issue from the linked question is much more difficult - I think it boils down to some change in vertical skip for nested itemizations, but I could not yet find it in the code. Sep 6 '18 at 14:11
  • @samcarter I'll take your word for it, you are the beamer expert. But surely the other issue is worth a bug report?
    – moewe
    Sep 6 '18 at 14:13
  • @moewe Yes, probably. I was actually planing to open an issue, but was waiting a day or two to see if I can come up with an idea how to fix. If you'd like to write one now, please feel free to do so! Sep 6 '18 at 14:17
5

Just to understand where your problem comes from, you could imagine the minipages as boxes. In your example they behave like this:

enter image description here


I would suggest columns instead of ordinary minipages. The main advantage is that they allow you to specify a top alignment across the columns which will allow a stable positions despite the fact that the second column changes height between the slides.

Alternatively you could use an overlayarea, but I think using columns is easier.

Unrelated to the problem: instead of replacing the whole itemize environment, you could just pass the overlay instructions to the individual items.

\documentclass[t]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage{mwe}

\begin{document}
\begin{frame}
\frametitle{Frame Title}
\begin{columns}[T,onlytextwidth]
\begin{column}{.24\textwidth}
    \vspace*{3cm}
    \includegraphics[width=\textwidth]{example-image}
\end{column}
\begin{column}{.74\textwidth}
    \includegraphics<1-2>[width=\textwidth]{example-image-a}
    \includegraphics<3>[width=\textwidth]{example-image-b}
    \begin{itemize}
        \item<only@1> blablabla1
        \item<only@2> blablabla2a
        \item<only@2> blablabla2b
        \item<only@3> blablabla3
    \end{itemize}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

5
  • wow ! Thank's a lot. I didn't think about columns. I'm running to write this on my beamer project and it should work :) Thank's for your answer.
    – Lionel
    Sep 7 '18 at 7:12
  • @Lionel I simplified the multiple itemize environments a bit, maybe this could be useful for you. Sep 7 '18 at 11:19
  • Nice ! Thanks :) Is it possible to use this syntax to display an item on 2 slides ? For example, on this case, if we want to display "blablabla1" on slide 1 and 2, <only@1-2> doesn't work. Is there something to add so the syntax accept the "-2" information ?
    – Lionel
    Sep 7 '18 at 15:35
  • @Lionel \item<only@{2,3}> blablabla2b or \item<only@{1-3}> blablabla2b Sep 7 '18 at 15:38
  • Ok, brackets then ! Nice My beamer files start to be clean !
    – Lionel
    Sep 7 '18 at 15:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.