Animate Tikz 无法正确编译

Animate Tikz 无法正确编译

末日审判旧版本pdflatex编译为静态 PDF,新版本可以正确编译 - Overleaf 也返回静态 PDF。

我正在玩animateTikZ,但无法编译任何动画 PDF。(操作系统 = KDE Neon(Ubuntu 18.04))

举个例子:动画集交叉点(例如,PDF文件和源代码均来自http://www.texample.net)。

当我从这里,它运行良好。

编辑:更正。我运行的代码来自这里在“独立版本”部分下。

\documentclass{beamer}
\usepackage{tikz}
\usepackage{animate}

\usepackage{fp}

% parameterized tikz graphics
\newcommand{\intersect}[1]{%
\def\setA{(0,0) circle (1)}%
\def\setB{(#1,0) circle (1)}%
% define the bounding box
\def\boundb{(-2,2) rectangle (4,-2)}%
%
\begin{tikzpicture}
    \draw \boundb;
    % intersection
    \begin{scope}
    \clip \setA;
    \fill[black!20] \setB;
    \end{scope}
    \begin{scope}[even odd rule]% first circle without the second
    \clip \setB \boundb;
    \fill[red!20] \setA;
    \end{scope}
    \begin{scope}[even odd rule]% first circle without the second
    \clip \setA \boundb;
    \fill[blue!20] \setB;
    \end{scope}
\draw \setA;
\draw \setB;
\node at (-1,0) [left] {$A$};
\node at (#1+1,0) [right] {$B$};
\node at (4,2) [below left] {$A\cap B$};
\end{tikzpicture}
}

\begin{document}

\begin{frame}
\frametitle{Set intersection}
\begin{center}

\begin{animateinline}[autoplay,palindrome]{12}
%first frame, xb=0.0
\gdef\xb{0}% xb initial value
\intersect{\xb}%
%remaining frames, xb=0.1...2.1
\whiledo{\lengthtest{\xb pt < 2.1pt}}{%
    \newframe
    \FPeval{xb}{\xb+0.1}% new xb
    \xdef\xb{\xb}% make \xb global
    \intersect{\xb}%
}%
\end{animateinline}

\end{center}
\end{frame}
\end{document}

当我编译代码时,pdflatex我得到了一个 PDF,但它不是动画。

该问题似乎是由于 PdfLaTeX 版本过时所致。

我在 KDE Neon 机器(Ubuntu 18.04)上使用 PdfLaTeX 编译时得到静态 PDF。以下是pdflatex --version

pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.34; using libpng 1.6.34
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with poppler version 0.62.0

但是,在运行 Manjaro 的机器上编译时,我得到了带有动画的 PDF。输出pdflatex --version

pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with poppler version 0.88.0

我不知道具体的区别是什么。但这似乎不是一个 TeX 问题——抱歉。

相关内容