修复 tikzpicture 的位置

修复 tikzpicture 的位置

当有叠加层时,我很难固定 tikzpicture 的位置。在示例中,由于文本叠加在图片下方,图片会稍微浮动。但是,我希望图片固定在准确的位置,这样当我滚动页面时,效果看起来只有文本在变化,而图片根本不动。

以下是我的示例:

\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}

备注:我不使用\uncover\onslide因为我不想留下空白。

答案1

避免任何潜在跳跃的最简单方法是使用顶部对齐的框架:

\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}

在此处输入图片描述

或者,您可以使用overlayarea合适高度的:

\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}

在此处输入图片描述

相关内容