2

I have a trouble in fixing the position of a tikzpicture when there is overlay. In the example, due to the overlay of the texts below the picture, the picture will float a bit. However, I would like the picture to be fixed at the exact position, such that when I scroll the pages the effect looks like only the text is changing but the picture doesn't move at all.

Here is my example:

\documentclass[10pt,xcolor={dvipsnames}]{beamer}
\usepackage{tikz}
\begin{document}
    \begin{frame}{title}
        \begin{center}
            \begin{tikzpicture}
                    \tikzset{
                round node/.style={circle,draw,inner sep=1.5}
                                    }
                \node [round node] (1) {1};
        \end{tikzpicture}
        \end{center}
    
    \begin{itemize}
        \only<1>{ \item By convention, we do not draw the information sets that contain a single node
            \item Therefore, any uncircled (or unlinked) decision node should be understood as a \textbf{singleton} information set}
        \item<2> In Figure (b), \textbf{player 2 has two singleton information sets}:
        \begin{itemize}
            \item The left one: player 2 knows that player 1 has chosen H
            \item The right one: player 2 knows that player 1 has chosen T
        \end{itemize}
    \end{itemize}
    \end{frame}
\end{document}

Remark: I don't use \uncover or \onslide because I don't want to leave blank space.

0

1 Answer 1

1

The easiest way to avoid any potential jumping is to use a top aligned frame:

\documentclass{beamer}
\usepackage{tikz}

\begin{document}
    
    \begin{frame}[t]{title}
        \begin{center}
            \begin{tikzpicture}
                    \tikzset{
                round node/.style={circle,draw,inner sep=1.5}
                                    }
                \node [round node] (1) {1};
        \end{tikzpicture}
        \end{center}
    
    \begin{itemize}
        \only<1>{ \item By convention, we do not draw the information sets that contain a single node
            \item Therefore, any uncircled (or unlinked) decision node should be understood as a \textbf{singleton} information set}
        \item<2> In Figure (b), \textbf{player 2 has two singleton information sets}:
        \begin{itemize}
            \item The left one: player 2 knows that player 1 has chosen H
            \item The right one: player 2 knows that player 1 has chosen T
        \end{itemize}
    \end{itemize}
    \end{frame}
\end{document}

enter image description here

Alternatively, you could use an overlayarea of suitable height:

\documentclass{beamer}
\usepackage{tikz}

\begin{document}
    
    \begin{frame}{title}
        \begin{center}
            \begin{tikzpicture}
                    \tikzset{
                round node/.style={circle,draw,inner sep=1.5}
                                    }
                \node [round node] (1) {1};
        \end{tikzpicture}
        \end{center}
    
    \begin{overlayarea}{\textwidth}{.5\textheight}
    \begin{itemize}
        \only<1>{ \item By convention, we do not draw the information sets that contain a single node
            \item Therefore, any uncircled (or unlinked) decision node should be understood as a \textbf{singleton} information set}
        \item<2> In Figure (b), \textbf{player 2 has two singleton information sets}:
        \begin{itemize}
            \item The left one: player 2 knows that player 1 has chosen H
            \item The right one: player 2 knows that player 1 has chosen T
        \end{itemize}
    \end{itemize}
    \end{overlayarea}
    \end{frame}
\end{document}

enter image description here

3
  • Wow, it is so cool!! I have tried dozens of super complex methods and none of them worked. Didn't expect such an easy solution. Thank you very much!!!!
    – PiHal
    Apr 12 at 11:23
  • @PiHal You're welcome! Apr 12 at 11:24
  • The second solution is even better! Because my actual tikzpicture is more complex, if I use top aligned frame, the position still changes a bit. But the second approach completely solved my problem. Thanks again!
    – PiHal
    Apr 12 at 11:32

Not the answer you're looking for? Browse other questions tagged .