[pstricks] [animate.sty] producing a sequence of Pstricks files

Patrick Drechsler patrick at pdrechsler.de
Tue Feb 12 01:27:20 CET 2008


Dear Herbert,

Herbert Voss <Herbert.Voss at FU-Berlin.DE> writes:

> \documentclass[12pt,a4paper]{article}
> \usepackage{animate}
> \usepackage{pstricks}
>
> \begin{document}
> \newcounter{count}
>
> \noindent%
> \begin{animateinline}[
>    begin={\begin{pspicture}(5,5)},
>    end={\end{pspicture}},
>    width=\linewidth,
>    controls]{5}
>    \whiledo{\thecount<5}{%
>      \newframe
>      \pscircle(\thecount,\thecount){1}
>      \stepcounter{count}%
>    }%
> \end{animateinline}
>
> \end{document}
>
> latex->dvips->ps2pdf

Thank you for sharing this example, Herbert!

This is very similar to the solution posted by Jürgen (he showed the
usage of "\multido", you show the usage of "\whiledo"). I prefer his
solution, because I can create to animation independent of the main pdf
file. But maybe I have just missed something obvious and I can include
the output from your examle in a different pdf file?


Here is a simple version of the output I was looking for (just for the
record):

main.tex:
--8<---------------cut here---------------start------------->8---
\documentclass{beamer}
\usepackage{animate}
\usepackage{graphicx}
\begin{document}
%% This file can be compiled with pdflatex. The image file "j-gilg-images.pdf"
%% (or "j-gilg-images-simple.pdf") has to be created with ghostscript >8.31.
\begin{center}
  \animategraphics[
  controls, loop,
  %% "high-end" example:
  % ]{4}{j-gilg-images}{}{}
  %% very simple example:
  ]{4}{j-gilg-images-simple}{}{}
\end{center}
\end{document}
--8<---------------cut here---------------end--------------->8---

j-gilg-images-simple.tex:
--8<---------------cut here---------------start------------->8---
%% needs ghostscript >8.31
%%
%% compile with latex, dvips, ps2pdf
%%
\documentclass{article}
\usepackage{pst-3dplot}
\usepackage{pstricks,pstricks-add}
\usepackage[nomessages]{fp}
\pagestyle{empty}
\begin{document}
%% This is the main pstricks macro:
\def\mycircle{
  \pscircle(\myX,\myY){0.5}
}
\def\myX{1}%
\def\myY{1}%
%
\multido{\i=1+1}{3}{%
 \begin{pspicture}(-2,-2)(2,2)
  \mycircle
 \end{pspicture}
 \newpage
 \FPadd{\myX}{\myX}{1}
 \FPadd{\myY}{\myY}{1}
}
\end{document}
--8<---------------cut here---------------end--------------->8---


Again, Herbert, Alan and Jürgen: Thank you for your help!

Cheers,

Patrick 
-- 
War is God's way of teaching Americans geography.
                                              -- Ambrose Bierce




More information about the PSTricks mailing list