In my opinion, it will be better if you cut the animation code from the host input file (presentation with beamer in your case ) and paste the animation code into a single, TeXable input file. TeX the animation input file to produce a PDF output. Later, you can make use of this PDF to create many other projects such as GIF animation, PDF animation (in your case), PNG images, etc. This separation method also make your host input file neater, cleaner, readable, understandable, etc.
Let Simple.tex
be the TeXable animation input file as follows:
%Simple.tex using standalone document class
\documentclass[pstricks,border=0pt]{standalone}
\usepackage{pstricks-add}
\newcommand\RotatingArrow[1]{%
\begin{pspicture}(-1,-1)(10,11)
\psframe*[linecolor=cyan,opacity=0.3](-1,-1)(10,11)
\psset{arrows=->}
\psaxes(0,0)(-0.5,-0.5)(9,10)[$x$,0][$y$,90]
\rput(4.5,0.6){\Huge{Temps = #1 s}}
\rput{#1}(4.5,5.5){%
\psset{arrowsize=5pt}
\pnode(2,0){A}
\pnode(2,3){B}
\psline[linecolor=blue](A)
\uput[0]{-#1}(A){\Huge{$\textcolor{blue}{\vec{a}}$}}
\psline[linecolor=red](A)(B)
\uput[90]{-#1}(B){\Huge{$\textcolor{red}{\vec{v}}$}}
}
\end{pspicture}}
\begin{document}
\multido{\i=0+10}{36}{\RotatingArrow{\i}}
\end{document}
For those who are unlucky to use standalone
document class, the last resort is to use preview
as follows. Note that standalone
also uses preview
internally.
\documentclass{article}
\usepackage{pstricks-add}
\usepackage[active,tightpage]{preview}
\PreviewBorder=0pt
\PreviewEnvironment{pspicture}
\newcommand\RotatingArrow[1]{%
\begin{pspicture}(-1,-1)(10,11)
\psframe*[linecolor=cyan,opacity=0.3](-1,-1)(10,11)
\psset{arrows=->}
\psaxes(0,0)(-0.5,-0.5)(9,10)[$x$,0][$y$,90]
\rput(4.5,0.6){\Huge{Temps = #1 s}}
\rput{#1}(4.5,5.5){%
\psset{arrowsize=5pt}
\pnode(2,0){A}
\pnode(2,3){B}
\psline[linecolor=blue](A)
\uput[0]{-#1}(A){\Huge{$\textcolor{blue}{\vec{a}}$}}
\psline[linecolor=red](A)(B)
\uput[90]{-#1}(B){\Huge{$\textcolor{red}{\vec{v}}$}}}
\end{pspicture}}
\begin{document}
\multido{\i=0+10}{36}{\RotatingArrow{\i}}
\end{document}
TeX it with either xelatex
or latex->dvips->ps2pdf
to get a PDF file. In our example, it will contain 36 pages to create a simple animation as follows.
Best Answer
1
beamer
class document in SVG formatThink about giving up the PDF format in favour of SVG.
Animations run in all contemporary Web browsers, while Blink-based ones (Chromium, Chrome, Opera) have the best performance. Also run on mobile devices.
Click the image to start presentation in the Web browser and press F11 for full-screen. Navigate through slides with PgUp and PgDown.
Compile the example code with
Example code
svgbeamer.tex
:2 Animated SVG as file attachment to PDF
animate
can export to standalone SVG animations, as outlined in https://tex.stackexchange.com/a/136919 . The SVG can be embedded as a file attachment to the PDF, and be run in a Web browser on click or touch:or without being attached:
In either case, the operating system/window manager must be configured to use a Web browser as default application for opening SVG files.
Chromium-based Web browsers (e. g. Chrome, Opera) should be used for viewing animated SVG, because of their extremely good rendering performance. The Lorenz attractor may serve as a test example.
3 As for PDF, ...
... there is very good news! Open-Source PDF viewers are catching up.
Okular from KDE now supports JavaScript-driven animations. See:
https://community.kde.org/GSoC/2019/StatusReports/Jo%C3%A3oNetto
Tested with Okular-1.10 (KDE-20.04.1)
We need an opensource PDF viewer with an opensource JavaScript engine added. All ingredients are there, e.g. Evince, Okular, JavaScriptCore from webkit.org (used by Apples web browser Safari), V8 (Google Chrome) or SpiderMonkey (Firefox).
MuPDF is a good starting point, but its integrated JavaScript support is quite rudimentary.
And the PDF rendering performance should be high, which is crucial for animations. MuPDF is one rendering library. The other two, Okular, Evince are based on the Poppler library.
The faster one, either MuPDF or Poppler should be chosen.
Someone should take up the challenge and put everything together.