当前位置: 代码迷 >> 综合 >> [Latex][beamer]PGF and TiKz中演示文字沿路径移动的动画
  详细解决方案

[Latex][beamer]PGF and TiKz中演示文字沿路径移动的动画

热度:44   发布时间:2024-01-04 01:41:23.0

[Latex][beamer]PGF and TiKz中演示文字沿路径移动的动画,就以beamer为例:

\documentclass{beamer}
%====================================================
\input{../setup/preamble.tex}  
\input{../setup/tikzall.tex} %包含所有的tikz包
%====================================================
\begin{document}
%====================================================
\begin{frame}
%演示文字沿路径移动的动画
\begin{animateinline}[autoplay,loop]{2}  
%总共生成6帧画面,以每秒2帧的速度自动播放    
\multiframe{6}{Rpos=1+-0.2}{%Rpos=1,0.8,...,0.0\tikz[allow upside down]{%\useasboundingbox[draw] (-1cm,-1cm) rectangle(4cm,4cm);\draw[name path=curveone] (0,0) .. controls +(right:3.5cm) and +(right:3.5cm) .. (0,3)\foreach \p in {0,0.2,0.4,0.6,0.8,1} {node[sloped,above,pos=\p]{\p}};\draw[name path=curveone] (0,0) .. controls +(right:3.5cm) and +(right:3.5cm) .. (0,3)node[sloped,below,pos=\Rpos]{$\Rpos$};}%
}%
\end{animateinline}\end{frame}
%====================================================
\end{document} 


效果是图如下: