我正在尝试让以下简单代码动画。第一个内联动画没有运行,但第二个动画运行了。出了什么问题?
\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}