
다음 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}
올바른 위치에 있어야 하는 것이 무엇인지 보여줍니다. 즉, 공개되는 항목의 순서가 정확합니다. 출력에서 내가 가진 유일한 문제는 테이블의 테두리(중앙선과 첫 번째 행)가 일부 변경될 때 이동한다는 것입니다. 요소가 공개됩니다. 두 개를 제자리에 유지하는 데 성공했지만 tikzpictures
테이블에 행렬을 추가하면 행렬도 이동하기 시작합니다.
전체 프레임에서 사물을 제자리에 유지하기 위해 동일한 기술을 적용한 것 같아서 문제가 어디에 있는지 잘 이해하지 못하지만 때로는 작동하지 않는 것 같습니다(이것내가 지침으로 삼은 것입니다.)... 아마도 이 문제에 잘못된 방식으로 접근하고 있는 것 같지만 필요한 곳에 빈 공간을 추가하는 것 외에는 제자리에 유지하는 방법을 잘 모르겠습니다.
다른 부분을 표시하면서 전체 테이블을 고정된 상태로 유지하는 방법에 대한 힌트를 주시면 감사하겠습니다.
답변1
[t]
이를 위해 만들어진 옵션과 라이브러리를 사용 overlay-beamer-styles
하고 숨겨진 공간을 버리면
\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}
중요한 점은 특별한 슬라이드에만 나타나도록 되어 있는 내용을 다른 슬라이드에서는 보이지 않게 만드는 것입니다. 그렇게 하면 이 항목이 여전히 경계 상자에 기여하므로 점프를 피할 수 있습니다.
행렬의 이동은 허위 공간에서 발생하며 %
적절한 곳에 문자를 추가하여 제거했습니다.
주제에서 벗어남: 여기서 사용하지 않는 라이브러리를 제거했습니다. pgf를 마음대로 사용할 수 있을 때 매크로를 사용해야 하는지 여부 \ifthenelse
는 모르겠지만 유지했습니다.
답변2
단지 다음을 사용하는 솔루션을 위해서overlayarea
\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}