为 beamer 类创建自定义转换

为 beamer 类创建自定义转换

我们都知道该类的标准转换beamer(例如\transblindhorizontal等等)。但我想知道是否可以进行自定义转换。以下是一个例子:考虑以下 MWE(非常粗略,但只是一个例子)。

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Singapore}
\usepackage{tikzpeople,tikz}
\setbeamertemplate{navigation symbols}{}
\usetikzlibrary{positioning,shapes,calc,arrows}
\definecolor{gruen}{RGB}{18,133,66}
\definecolor{hell}{RGB}{55,181,74}
\tikzset{
    dollar/.style={
        append after command={
            \pgfextra{
                \node[draw,minimum width=1cm,minimum height=.5cm] (a) at (\tikzlastnode)
                {};
                \fill[gruen] (a.north west) rectangle (a.south east);
                \fill[white,radius=.04] ([xshift=.1cm,yshift=-.1cm]a.north west) circle;
                \fill[white,radius=.04] ([xshift=.1cm,yshift=.1cm]a.south west) circle;
                \fill[white,radius=.04] ([xshift=-.1cm,yshift=.1cm]a.south east) circle;
                \fill[white,radius=.04] ([xshift=-.1cm,yshift=-.1cm]a.north east) circle;
                \fill[hell] ([xshift=-.1cm,yshift=.2cm]a.south east) arc(90:180:.1) -- ([xshift=.2cm,yshift=.1cm]a.south west) arc(0:90:.1) -- ([xshift=.1cm,yshift=-.2cm]a.north west) arc(270:360:.1) -- ([xshift=-.2cm,yshift=-.1cm]a.north east) arc(180:270:.1) -- cycle;
                \fill[gruen,radius=.1cm] ($(a.north west)!.5!(a.south east)$) circle;
                \node[white] at ($(a.north west)!.5!(a.south east)$) {\tiny\sf\$};
            }
        }
    }
}
\begin{document}
    \begin{frame}
        \resizebox{\textwidth}{!}{
        \begin{tikzpicture}[>=stealth]
            \node[yshift=-.5cm,label=above:{\tiny Geldgeber},dave] (dave) {};
            \node[label=below right:{\scalebox{1}[1]{\tiny eig. Empfänger}},businessman,right=2 of dave] (businessman) {};
            \node[label=above:{\tiny Kriminelle},criminal,right=1 of dave,yshift=-1.5cm] (criminal) {};
                \draw[->] (dave) |- (criminal);;
                \draw[<-] (criminal) to[bend right=45] (businessman);
            \uncover<2>{\scalebox{.4}[.4]{\node[dollar] at (1.05,-1.05) {};}\scalebox{.4}[.4]{\node[dollar] at (1.2,-1.2) {};}\scalebox{.4}[.4]{\node[dollar] at (1.35,-1.35) {};}}
            \uncover<3->{
                \scalebox{.4}[.4]{\node[dollar] (b) at (2.5,-6) {};}
                \scalebox{.4}[.4]{\node[dollar] (a) at (4.7,-1.1) {};}\scalebox{.4}[.4]{\node[dollar] at (4.8,-1.2) {};}
                }
            \uncover<3>{\draw[<-,very thin,dashed] ([scale=.4,yshift=.12cm]b.north) -- (dave);\draw[->,very thin,dashed] (dave) -- ([scale=.4,xshift=-.1cm]a.west);}
            \uncover<4>{\node[ellipse callout,draw,yshift=.4cm,callout absolute pointer={(businessman.mouth)},font=\tiny] at (3.3,0) {Hey!};}
        \end{tikzpicture}
    }
    \end{frame}
\end{document}

我如何制作一个过渡来展示美元钞票如何“行走”在其路径上。我认为使用动画线是可行的,但我真的很希望通过选项\walkalong(例如\transboxout)使用此过渡。

答案1

转换并不嵌入在 pdf 本身中,仅仅是 pdf 查看器使用 pdf 标准中识别的转换之一的信息。

这意味着您无法向您的 Beamer 演示文稿添加自定义过渡,除非您还能说服 pdf 查看器等的创建者识别您的新过渡。


也就是说,你可以使用其他技术为你的美元钞票创建动画,例如如何将两个或多个平行图像移动到投影机中的固定位置相交

\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usetheme{Singapore}
\usepackage{tikzpeople,tikz}
\setbeamertemplate{navigation symbols}{}
\usetikzlibrary{positioning,shapes,calc,arrows}
\definecolor{gruen}{RGB}{18,133,66}
\definecolor{hell}{RGB}{55,181,74}
\tikzset{
    dollar/.style={
        append after command={
            \pgfextra{
                \node[draw,minimum width=1cm,minimum height=.5cm] (a) at (\tikzlastnode)
                {};
                \fill[gruen] (a.north west) rectangle (a.south east);
                \fill[white,radius=.04] ([xshift=.1cm,yshift=-.1cm]a.north west) circle;
                \fill[white,radius=.04] ([xshift=.1cm,yshift=.1cm]a.south west) circle;
                \fill[white,radius=.04] ([xshift=-.1cm,yshift=.1cm]a.south east) circle;
                \fill[white,radius=.04] ([xshift=-.1cm,yshift=-.1cm]a.north east) circle;
                \fill[hell] ([xshift=-.1cm,yshift=.2cm]a.south east) arc(90:180:.1) -- ([xshift=.2cm,yshift=.1cm]a.south west) arc(0:90:.1) -- ([xshift=.1cm,yshift=-.2cm]a.north west) arc(270:360:.1) -- ([xshift=-.2cm,yshift=-.1cm]a.north east) arc(180:270:.1) -- cycle;
                \fill[gruen,radius=.1cm] ($(a.north west)!.5!(a.south east)$) circle;
                \node[white] at ($(a.north west)!.5!(a.south east)$) {\tiny\sf\$};
            }
        }
    }
}
\begin{document}
    \begin{frame}
    \transduration<0-9>{0.1}
        \begin{tikzpicture}[>=stealth,scale=2]
            \node[yshift=-.5cm,label=above:{\tiny Geldgeber},dave] (dave) {};
            \node[label=below right:{\tiny eig. Empfänger},businessman,right=2 of dave] (businessman) {};
            \node[label=above:{\tiny Kriminelle},criminal,right=1 of dave,yshift=-1.5cm] (criminal) {};
            \draw[->] (dave) |- (criminal);;
            \draw[<-] (criminal) to[bend right=45] (businessman);
            \foreach \x in{1,1.1,...,2}{
                \scalebox{.4}[.4]{\node<+>[dollar] at (\x,-1.05) {};}
            }
        \end{tikzpicture}
    \end{frame}
\end{document}

enter image description here

相关内容