2

Why doesn't this work?

\phantom{
      \begin{figure}[H]
        \includegraphics{fig.pdf}
      \end{figure}
}

It outputs

Error: Something's wrong--perhaps a missing \item.

I'm trying to do something like this

\begin{frame}
  \only<1>{%
    \begin{tabular}{r|ccc}
      Cool table & $a$ & $b$ & $c$ \\\hline
      $a$ & 1 & 1 & 0 \\
      $b$ & 1 & 1 & 1 \\
    \end{tabular}\\
  }
  \only<2>{%
    \begin{tabular}{r|ccc}
      Cool table & $a$ & $b$ & $c$ \\\hline
      $a$ & 1 & \color{red}1 & 0 \\
      $b$ & 1 & 1 & 1 \\
    \end{tabular}\\
  }
  \only<3>{%
    \begin{tabular}{r|ccc}
      Cool table & $a$ & $b$ & $c$ \\\hline
      $a$ & 1 & 1 & \color{red}0 \\
      $b$ & 1 & 1 & 1 \\
    \end{tabular}\\
  }
  \only<2>{%
    \begin{figure}
      \centering
      \includegraphics{../shared/arrows_0.pdf}
    \end{figure}
  }
  \only<3>{%
    \begin{figure}
      \centering
      \includegraphics{../shared/arrows_1.pdf}
    \end{figure}
  }
\end{frame}

And I don't want the table or the picture to jump.

  • 1
    Well figure is rather complex environment. What you are trying to achieve? – Ulrike Fischer Apr 10 '21 at 18:03
  • 1
    And don't use the H specifier unless you really knows what it does and when to use it. – daleif Apr 10 '21 at 18:14
  • I updated my post – Volker Weißmann Apr 10 '21 at 18:17
  • 2
    use \visible or \uncover instead of \only. Check the beamer docu about the differences. – Ulrike Fischer Apr 10 '21 at 18:30
  • The problem is that if I have a figure in an \uncover environment, this means that on every other slide, I have a whitespace in the size of the figure, which is not what I want. I only want this whitespace on the first slide. – Volker Weißmann Apr 10 '21 at 19:12
  • So the real issue is how to avoid jumps using beamer. There are several similar questions here. See https://tex.stackexchange.com/questions/269903/avoiding-jumps-when-using-beamer-overlays?r=SearchResults&s=1|63.6325 for example. – John Kormylo Apr 11 '21 at 00:47

0 Answers0