
Considere el siguiente 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}
Muestra lo que debería en la posición correcta, es decir, el orden de las cosas que se revelan es correcto. El único problema que tengo con el resultado es que los bordes de la tabla (la línea central y la primera fila) cambian cuando algunos Los elementos se revelan. Logré que los dos tikzpictures
permanecieran en su lugar, pero cuando agrego las matrices a la tabla también comienzan a moverse...
Realmente no entiendo dónde está el problema, ya que creo que apliqué la misma técnica para mantener las cosas en su lugar en todo el cuadro, pero a veces parece que no funciona (estees lo que tomé como guía)... Probablemente estoy abordando este problema de manera incorrecta, pero realmente no sé cómo mantener las cosas en su lugar aparte de agregar espacio vacío cuando sea necesario.
Se agradece cualquier sugerencia sobre cómo puedo hacer que toda la mesa permanezca fija mientras se revelan las diferentes partes.
Respuesta1
Si usas la [t]
opción y la overlay-beamer-styles
biblioteca, que está hecha para esto, y descartas los espacios ocultos obtendrás
\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}
El punto importante es hacer que las cosas que aparecerán sólo en diapositivas especiales sean invisibles en las otras diapositivas. De esa manera, esto todavía contribuye al cuadro delimitador y, por lo tanto, permite evitar saltos.
En cuanto a los desplazamientos de las matrices, provienen de espacios espurios, que eliminé agregando caracteres %
cuando correspondía.
Fuera de tema: eliminé bibliotecas que no están en uso aquí. \ifthenelse
No sé si uno debe usar o no la macro cuando tiene pgf a su disposición, pero la conservé.
Respuesta2
Sólo por el bien de una solución 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}