Deslocamento indesejado de objetos no quadro do projetor

Deslocamento indesejado de objetos no quadro do projetor

Considere o seguinte MWE

\documentclass{beamer}
\usepackage{tikz}
\usepackage{tikz-3dplot}
\usetikzlibrary{positioning}% To get more advances positioning options
\usetikzlibrary{arrows}% To get more arrow heads
\usetikzlibrary{math,calc}
\usetikzlibrary{arrows.meta, bending, decorations.markings, angles, quotes, fit}
\usetikzlibrary{tikzmark}
\usetikzlibrary{scopes}
\mode<presentation> {
    \usetheme{Boadilla}

    \setbeamertemplate{footline}{}% get rid of footer completely 
}

\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{amssymb, mathtools, amsfonts}

\definecolor{MyColor1}{rgb}{0.24, 0.59, 0.32}
\definecolor{MyColor2}{rgb}{0.85, 0.49, 0.19}
\definecolor{MyColor3}{rgb}{0.22, 0.42, 0.69}

\usepackage{tikz}

\usefonttheme{serif}

\begin{document}

\begin{frame}\frametitle{Examples}
    \begin{center}
        \begin{tabular}{c|c}
            \onslide<1->{
                $\langle\alpha,\beta\rangle = \langle\beta,\alpha\rangle =-1$ 
                & $3\langle\alpha,\beta\rangle= \langle\beta,\alpha\rangle=-3$\\\midrule
                & \\
                \begin{tikzpicture}[scale=0.7, every node/.style={transform shape}]
                    \draw (-2,-2) rectangle (2,2);
                    \node (alpha) at (1.2,0) {$\alpha$};
                    \node (beta) at (120:1.2) {$\beta$};
                    \draw[->] (0,0) -- (0:1);
                    \draw[->] (0,0) -- (120:1);
                    \only<1>{
                    \foreach \angle in {60,180,240,300}{
                        \draw[->] (0,0) -- (\angle:1);
                    }
                    }
                    \draw[MyColor1] (0.5,0) arc (0:120:0.5);
                    \draw[fill=MyColor1, opacity=0.3] (0,0) -- (0.5,0) arc (0:120:0.5) -- cycle;
                \end{tikzpicture} &
                \begin{tikzpicture}[scale=0.7, every node/.style={transform shape}]
                    \draw (-2,-2) rectangle (2,2);
                    \node (alpha) at (1.2,0) {$\alpha$};
                    \node (beta) at (150:1.9) {$\beta$};
                    \draw[->] (0,0) -- (150:1.7320);
                    \draw[->] (0,0) -- (0:1);
                    \only<1>{
                    \foreach \angle in {30,60,90,120,180,210,240,270,300,330}{
                        \pgfmathsetmacro{\bigradius}{sqrt(3)}
                        \ifthenelse{\angle=30 \OR 
                                    \angle=90 \OR 
                                    \angle=150 \OR 
                                    \angle=210 \OR
                                    \angle=270 \OR 
                                    \angle=330}{
                                        \draw[->] (0,0) -- (\angle:\bigradius);
                                    }{
                                        \draw[->] (0,0) -- (\angle:1);
                                    };
                    }
                    }
                    \draw[MyColor1] (0.5,0) arc (0:150:0.5);
                    \draw[fill=MyColor1, opacity=0.3] (0,0) -- (0.5,0) arc (0:150:0.5) -- cycle;
                \end{tikzpicture}\\
                & \\}
            \only<2->{
            \only<3>{
                $\begin{pmatrix*}[r] \hphantom{-2}  & \hphantom{-1}\\ 
                                 \hphantom{-1} & \hphantom{-2}
                \end{pmatrix*}$}
            \only<4->{
                $\begin{pmatrix*} 
                    \only<4->{-2}  & \only<5->{\color<5->{MyColor1}{-1}}\\ 
                    \only<5->{\color<5->{MyColor1}{-1}} & \only<4->{-2}
                \end{pmatrix*}$} 
                & 
            \only<3>{
                $\begin{pmatrix} \hphantom{-2}  & \hphantom{-1}\\ 
                                    \hphantom{-1} & \hphantom{-2}
                \end{pmatrix}$}
            \only<4->{
            $\begin{pmatrix*}[r] \only<4->{-2}  & \only<5->{\color<5->{MyColor1}{-1}}\\ 
                             \only<5->{\color<5->{MyColor1}{-3}} & \only<3->{-2}
            \end{pmatrix*}$}
            }
        \end{tabular}
    \end{center}
\end{frame}
\end{document}

Ele mostra o que deveria estar na posição correta, ou seja, a ordem das coisas que é revelada está correta. O único problema que tenho com a saída é que as bordas da tabela (a linha central e a primeira linha) mudam quando alguns elementos são revelados. Consegui fazer com que as duas tikzpicturesficassem no lugar, mas quando adiciono as matrizes na mesa elas também começam a mudar...

Eu realmente não entendo onde está o problema, pois acho que apliquei a mesma técnica para manter as coisas no lugar em todo o quadro, mas às vezes parece não funcionar (esseé o que tomei como orientação)... Provavelmente estou abordando esse problema da maneira errada, mas não sei realmente como manter as coisas no lugar, a não ser adicionar espaço vazio quando necessário.

Qualquer dica sobre como posso fazer com que a mesa inteira fique fixa enquanto revelo as diferentes partes será apreciada.

Responder1

Se você usar a [t]opção e a overlay-beamer-stylesbiblioteca, que é feita para isso, e descartar os espaços ocultos você obtém

\documentclass{beamer}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{overlay-beamer-styles}
\mode<presentation> {
    \usetheme{Boadilla}

    \setbeamertemplate{footline}{}% get rid of footer completely 
}

\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{amssymb, mathtools, amsfonts}

\definecolor{MyColor1}{rgb}{0.24, 0.59, 0.32}
\definecolor{MyColor2}{rgb}{0.85, 0.49, 0.19}
\definecolor{MyColor3}{rgb}{0.22, 0.42, 0.69}


\usefonttheme{serif}

\begin{document}

\begin{frame}[t]
\frametitle{Examples}
    \begin{center}
        \begin{tabular}{c|c}
            \onslide<1->{
                $\langle\alpha,\beta\rangle = \langle\beta,\alpha\rangle =-1$ 
                & $3\langle\alpha,\beta\rangle= \langle\beta,\alpha\rangle=-3$\\\midrule
                & \\
                \begin{tikzpicture}[scale=0.7, every node/.style={transform shape}]
                    \draw (-2,-2) rectangle (2,2);
                    \node (alpha) at (1.2,0) {$\alpha$};
                    \node (beta) at (120:1.2) {$\beta$};
                    \draw[->] (0,0) -- (0:1);
                    \draw[->] (0,0) -- (120:1);                 
                    \foreach \angle in {60,180,240,300}{
                        \draw[->,visible on=<1>] (0,0) -- (\angle:1);
                    }
                    \draw[MyColor1] (0.5,0) arc (0:120:0.5);
                    \draw[fill=MyColor1, opacity=0.3] (0,0) -- (0.5,0) arc (0:120:0.5) -- cycle;
                \end{tikzpicture} &
                \begin{tikzpicture}[scale=0.7, every node/.style={transform shape}]
                    \draw (-2,-2) rectangle (2,2);
                    \node (alpha) at (1.2,0) {$\alpha$};
                    \node (beta) at (150:1.9) {$\beta$};
                    \draw[->] (0,0) -- (150:1.7320);
                    \draw[->] (0,0) -- (0:1);
                    \begin{scope}[visible on=<1>]
                    \foreach \angle in {30,60,90,120,180,210,240,270,300,330}{
                        \pgfmathsetmacro{\bigradius}{sqrt(3)}
                        \ifthenelse{\angle=30 \OR 
                                    \angle=90 \OR 
                                    \angle=150 \OR 
                                    \angle=210 \OR
                                    \angle=270 \OR 
                                    \angle=330}{
                                        \draw[->] (0,0) -- (\angle:\bigradius);
                                    }{
                                        \draw[->] (0,0) -- (\angle:1);
                                    };
                    }
                    \end{scope}
                    \draw[MyColor1] (0.5,0) arc (0:150:0.5);
                    \draw[fill=MyColor1, opacity=0.3] (0,0) -- (0.5,0) arc (0:150:0.5) -- cycle;
                \end{tikzpicture}\\
                & \\}
            \only<2->{%
            \only<3>{%
                $\begin{pmatrix*}[r] \hphantom{-2}  & \hphantom{-1}\\ 
                                 \hphantom{-1} & \hphantom{-2}
                \end{pmatrix*}$}%
            \only<4->{%
                $\begin{pmatrix*} 
                    \only<4->{-2}  & \only<5->{\color<5->{MyColor1}{-1}}\\ 
                    \only<5->{\color<5->{MyColor1}{-1}} & \only<4->{-2}
                \end{pmatrix*}$}% 
                & 
            \only<3>{%
                $\begin{pmatrix} \hphantom{-2}  & \hphantom{-1}\\ 
                                    \hphantom{-1} & \hphantom{-2}
                \end{pmatrix}$}%
            \only<4->{%
            $\begin{pmatrix*}[r] \only<4->{-2}  & \only<5->{\color<5->{MyColor1}{-1}}\\ 
                             \only<5->{\color<5->{MyColor1}{-3}} & \only<3->{-2}
            \end{pmatrix*}$}%
            }%
        \end{tabular}
    \end{center}
\end{frame}
\end{document}

insira a descrição da imagem aqui

O ponto importante é tornar invisíveis os itens que aparecerão apenas em slides especiais nos outros slides. Dessa forma esse material ainda contribui para a caixa delimitadora, evitando assim saltos.

Quanto aos deslocamentos das matrizes, eles vêm de espaços espúrios, que removi adicionando os %caracteres quando apropriado.

Fora do tópico: removi bibliotecas que não estão em uso aqui. Se se deve ou não usar a \ifthenelsemacro quando se tem o pgf à disposição, não sei, mas guardei-a.

Responder2

Apenas por uma questão de solução usandooverlayarea

\documentclass{beamer}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{overlay-beamer-styles}
\mode<presentation> {
    \usetheme{Boadilla}

    \setbeamertemplate{footline}{}% get rid of footer completely 
}

\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage{amssymb, mathtools, amsfonts}

\definecolor{MyColor1}{rgb}{0.24, 0.59, 0.32}
\definecolor{MyColor2}{rgb}{0.85, 0.49, 0.19}
\definecolor{MyColor3}{rgb}{0.22, 0.42, 0.69}


\usefonttheme{serif}

\begin{document}

\begin{frame}\frametitle{Examples}
    \begin{overlayarea}{\textwidth}{0.5\paperheight}

        \begin{center}
            \begin{tabular}{c|c}
                \onslide<1->{%
                    $\langle\alpha,\beta\rangle = \langle\beta,\alpha\rangle =-1$ 
                    & $3\langle\alpha,\beta\rangle= \langle\beta,\alpha\rangle=-3$\\\midrule
                    & \\
                    \begin{tikzpicture}[scale=0.7, every node/.style={transform shape}]
                        \draw (-2,-2) rectangle (2,2);
                        \node (alpha) at (1.2,0) {$\alpha$};
                        \node (beta) at (120:1.2) {$\beta$};
                        \draw[->] (0,0) -- (0:1);
                        \draw[->] (0,0) -- (120:1);
                        \only<1>{
                            \foreach \angle in {60,180,240,300}{
                                \draw[->] (0,0) -- (\angle:1);
                                }
                                }
                                \draw[MyColor1] (0.5,0) arc (0:120:0.5);
                                \draw[fill=MyColor1, opacity=0.3] (0,0) -- (0.5,0) arc (0:120:0.5) -- cycle;
                            \end{tikzpicture} &
                            \begin{tikzpicture}[scale=0.7, every node/.style={transform shape}]
                                \draw (-2,-2) rectangle (2,2);
                                \node (alpha) at (1.2,0) {$\alpha$};
                                \node (beta) at (150:1.9) {$\beta$};
                                \draw[->] (0,0) -- (150:1.7320);
                                \draw[->] (0,0) -- (0:1);
                                \only<1>{
                                    \foreach \angle in {30,60,90,120,180,210,240,270,300,330}{
                                        \pgfmathsetmacro{\bigradius}{sqrt(3)}
                                        \ifthenelse{\angle=30 \OR 
                                        \angle=90 \OR 
                                        \angle=150 \OR 
                                        \angle=210 \OR
                                        \angle=270 \OR 
                                        \angle=330}{
                                            \draw[->] (0,0) -- (\angle:\bigradius);
                                            }{
                                                \draw[->] (0,0) -- (\angle:1);
                                                };
                                                }
                                                }
                                                \draw[MyColor1] (0.5,0) arc (0:150:0.5);
                                                \draw[fill=MyColor1, opacity=0.3] (0,0) -- (0.5,0) arc (0:150:0.5) -- cycle;
                                            \end{tikzpicture}\\
                                            & \\}%
            \only<2->{%
                \only<3>{%
                    $\begin{pmatrix*}[r] \hphantom{-2}  & \hphantom{-1}\\ 
                        \hphantom{-1} & \hphantom{-2}
                    \end{pmatrix*}$}%
                    \only<4->{%
                        $\begin{pmatrix*} 
                            \only<4->{-2}  & \only<5->{\color<5->{MyColor1}{-1}}\\ 
                            \only<5->{\color<5->{MyColor1}{-1}} & \only<4->{-2}
                        \end{pmatrix*}$}
                        & 
                        \only<3>{%
                            $\begin{pmatrix} \hphantom{-2}  & \hphantom{-1}\\ 
                                \hphantom{-1} & \hphantom{-2}
                            \end{pmatrix}$}%
                            \only<4->{%
                                $\begin{pmatrix*}[r] \only<4->{-2}  & \only<5->{\color<5->{MyColor1}{-1}}\\ 
                                    \only<5->{\color<5->{MyColor1}{-3}} & \only<3->{-2}
                                \end{pmatrix*}$}%
                                }%
                            \end{tabular}
                        \end{center}
                    \end{overlayarea}
                    \end{frame}
                    \end{document}

informação relacionada