多个 Beamer 框架中共享的时间线

多个 Beamer 框架中共享的时间线

本问题是“Beamer 演示文稿中带有日期的演变栏“。

我正在测试的 beamer-tikz 代码是:

\documentclass{beamer}
\setbeamercovered{transparent}
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
 \tikzset{
    highlight on/.style={alt={#1{fill=red!80!black,color=red!80!black}{fill=gray!30!white,color=gray!30!white}}},
}
\begin{document}
\begin{frame}[t]
\frametitle{Timeline}
\begin{tikzpicture}%[scale=0.9, every node/.style={scale=0.6}]
% \draw[line width=2mm,-latex,red!20] (-0.2,0) -- (9,0);
\draw[line width=1mm,-latex,red!20] (-0.2,0) -- (\textwidth+0.2,0);
\foreach \X [evaluate=\X as \Y using int(\X-2000),count=\Z] in {2000,2001,2002,2005,2008,2015}
{
\draw[highlight on=<\Z>] ({\Y-0.2},-0.5) -- ({\Y+0.2},-0.5) -- (\Y,-0.1) -- cycle;
\node[anchor=south,highlight on=<\Z>,fill=white] at (\Y,0.2) {\X};
}
\end{tikzpicture}
\begin{itemize}
\item<1> November 2000: marmots start hibernating
\item<2> August 2001: marmots eat
\item<2> Semptember 2001: marmots eat
\item<3> July 2002: marmots eat
\item<4> May 2005: marmots awake from hibernation
\item<4> November 2005: marmots start hibernating again
\end{itemize}
\end{frame}
\end{document}

但是,2015 年似乎超出了时间线。此外,我想创建第二个框架,使用相同的时间线标记(2000、2001、2002、2005、2008、2015),但包含 2008 年和 2015 年的项目(\item<5>\item<6>)。

答案1

噢,这么多土拨鼠!;-)

\documentclass{beamer}
\setbeamercovered{transparent}
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
 \tikzset{
    highlight on/.style={alt={#1{fill=red!80!black,color=red!80!black}{fill=gray!30!white,color=gray!30!white}}},
}
\begin{document}
\begin{frame}[t]
\frametitle{Timeline}
\begin{tikzpicture}[xscale=0.5]%[scale=0.9, every node/.style={scale=0.6}]
% \draw[line width=2mm,-latex,red!20] (-0.2,0) -- (9,0);
\draw[line width=1mm,-latex,red!20] (-0.2,0) -- (20+0.2,0);
\foreach \X [evaluate=\X as \Y using int(\X-2000),count=\Z] in {2000,2001,2002,2005,2008,2015}
{
\draw[highlight on=<\Z>] ({\Y-0.2},-0.5) -- ({\Y+0.2},-0.5) -- (\Y,-0.1) -- cycle;
\node[anchor=south,highlight on=<\Z>,fill=white,rotate=45,anchor=south
west,inner sep=0pt] at (\Y,0.2) {\X};
}
\end{tikzpicture}
\begin{itemize}
\item<1> November 2000: marmots start hibernating
\item<2> August 2001: marmots eat
\item<2> Semptember 2001: marmots eat
\item<3> July 2002: marmots eat
\item<4> May 2005: marmots awake from hibernation
\item<4> November 2005: marmots start hibernating again
\item<5> May 2008: marmots drink honey liquor
\item<6> July 2015: marmots eat pineapple cake
\end{itemize}
\end{frame}
\end{document}

在此处输入图片描述

附录:下一帧继续。

\documentclass{beamer}
\setbeamercovered{transparent}
\usepackage{tikz}
\usetikzlibrary{overlay-beamer-styles}
 \tikzset{
    highlight on/.style={alt={#1{fill=red!80!black,color=red!80!black}{fill=gray!30!white,color=gray!30!white}}},
}
\begin{document}
\begin{frame}[t]
\frametitle{Timeline}
\begin{tikzpicture}[xscale=0.5]%[scale=0.9, every node/.style={scale=0.6}]
% \draw[line width=2mm,-latex,red!20] (-0.2,0) -- (9,0);
\draw[line width=1mm,-latex,red!20] (-0.2,0) -- (20+0.2,0);
\foreach \X [evaluate=\X as \Y using int(\X-2000),count=\Z] in {2000,2001,2002,2005,2008,2015}
{
\draw[highlight on=<\Z>] ({\Y-0.2},-0.5) -- ({\Y+0.2},-0.5) -- (\Y,-0.1) -- cycle;
\node[anchor=south,highlight on=<\Z>,fill=white,rotate=45,anchor=south
west,inner sep=0pt] at (\Y,0.2) {\X};
}
\end{tikzpicture}
\begin{itemize}
\item<1> November 2000: marmots start hibernating
\item<2> August 2001: marmots eat
\item<2> Semptember 2001: marmots eat
\item<3> July 2002: marmots eat
\item<4> May 2005: marmots awake from hibernation
\item<4> November 2005: marmots start hibernating again
\item<5> May 2008: marmots drink honey liquor
\item<6> July 2015: marmots eat pineapple cake
\end{itemize}
\end{frame}

\begin{frame}[t]
    \frametitle{Historial}
\begin{tikzpicture}[xscale=0.5]
\draw[line width=1.5mm,-latex,red!20] (-0.2,0) -- (20+0.2,0);
\foreach \X [evaluate=\X as \Y using int(\X-2000),count=\Z] in {2000,2001,2002} %<- these are the years not to be highlighted
{
\draw[highlight on=<0>] ({\Y-0.2},-0.5) -- ({\Y+0.2},-0.5) -- (\Y,-0.1) -- cycle;
\node[anchor=south,highlight on=<0>,fill=white,rotate=45,anchor=south
west,inner sep=0pt] at (\Y,0.2) {\X};
}
\foreach \X [evaluate=\X as \Y using int(\X-2000),count=\Z] in {2005,2008,2015} %<- these are the years which are to be highlighted
{
\draw[highlight on=<\Z>] ({\Y-0.2},-0.5) -- ({\Y+0.2},-0.5) -- (\Y,-0.1) -- cycle;
\node[anchor=south,highlight on=<\Z>,fill=white,rotate=45,anchor=south
west,inner sep=0pt] at (\Y,0.2) {\X};
}
\end{tikzpicture}
\begin{itemize}
    \item<1> November 2005: marmots start hibernating again
    \item<2> May 2008: marmots drink honey liquor
    \item<3> July 2015: marmots eat pineapple cake
\end{itemize}
\end{frame}
\end{document}

在此处输入图片描述

相关内容