1

I try to use "animate" with xelatex. As first example, I use a code from http://tug.org/PSTricks/main.cgi?file=Animation/basics and put it in a minimal document for xelatex.

The compilation doesn't work with xelatex : there is a ouput but many things ara missing. Do you have an idea how to make this work ? (I would like to learn to use animate with pstricks, not tickz ...)

Thank's

\documentclass[a4paper,11pt]{article}

\usepackage[tuenc]{fontspec}

\usepackage[a4paper,centering,reversemarginpar]{geometry}
\usepackage[french]{babel}

\usepackage{animate}
\usepackage{pst-plot}\SpecialCoor
\usepackage{multido}


\begin{document}

  %-------------------- write timeline file ---------------------%
  \newwrite\TimeLineFile
  \immediate\openout\TimeLineFile=sinus.txt
  \immediate\write\TimeLineFile{::0x0,1}%
  %remaining frames: overlay filled circle at its current postion
  \multido{\i=2+1}{90}{%
    \immediate\write\TimeLineFile{%
      ::\i % put filled circle on top
  }}
  \immediate\closeout\TimeLineFile
  %------------------- assemble animation -----------------------%
  \psset{xunit=\pstRadUnit,dashadjust=false}
  \begin{animateinline}[controls,timeline=sinus.txt,
    begin={\begin{pspicture}(-0.5,-1.5)(6.6,2)},
    end={\end{pspicture}}]{24}
    %---- static material: axes, labels, curve ----%
    \psaxes[trigLabels,trigLabelBase=3]{->}(0,0)(-2mm,-1.5)(6.5,1.5)[t,-90][$y=\sin(t)$,0]
    \psplot[xunit=1cm,linestyle=dashed,algebraic]{0}{\psPiTwo}{sin(x)}
    \newframe
    \multiframe{91}{n=0+4}{\psset{xunit=1cm,linecolor=blue}
      \psdot[dotsize=3mm](!\n\space dup DegtoRad exch sin)
      \psline[linestyle=dashed](!\n\space dup DegtoRad exch sin)(!\n\space DegtoRad 0)
    }
  \end{animateinline}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.