![无法获得基本动画 Tikz](https://linux22.com/image/348495/%E6%97%A0%E6%B3%95%E8%8E%B7%E5%BE%97%E5%9F%BA%E6%9C%AC%E5%8A%A8%E7%94%BB%20Tikz.png)
我正在尝试让以下简单代码动画。第一个内联动画没有运行,但第二个动画运行了。出了什么问题?
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{animate}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{ifthen}
\begin{document}
\begin{animateinline}[autoplay,
begin={\begin{tikzpicture}},end={\end{tikzpicture}}
]{1}%
\multiframe{5}{iAlpha=1+1}{%
\draw (0,0) -- (\iAlpha , \iAlpha );
}%
\end{animateinline}
\begin{animateinline}[autoplay]{1}
\multiframe{5}{iCount=1+1}{
Frame \iCount}
\end{animateinline}
\end{document}
答案1
帧被缩放以适应第一帧的尺寸。为所有帧添加一个公共边界框。这可以防止第 2-5 帧被缩小。
另请参阅此主题: 动画中的帧大小错误
\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{animate}
\usetikzlibrary{decorations.pathreplacing}
\usepackage{ifthen}
\begin{document}
\begin{animateinline}[autoplay,
begin={
\begin{tikzpicture}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\useasboundingbox (0, 0) rectangle (5, 5);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
},end={\end{tikzpicture}}
]{1}%
\multiframe{5}{iAlpha=1+1}{%
\draw (0,0) -- (\iAlpha , \iAlpha );
}%
\end{animateinline}
\begin{animateinline}[autoplay]{1}
\multiframe{5}{iCount=1+1}{
Frame \iCount}
\end{animateinline}
\end{document}