# pst-func animation example does not work

The following, which is provided in the pst-func documentation, does not seem to run correctly but I can correctly run the animation in the pdf documentation file. I used XeLaTeX to compile it.

\documentclass{article}
\usepackage{graphicx,caption,pst-func,animate}

\newcommand{\studentT}[1]{%
\psset{xunit=0.9cm,yunit=9cm}
\begin{pspicture}(-6,-0.1)(6,0.5)
\psaxes[Dy=0.1]{->}(0,0)(-5,0)(5.5,0.45)[$x$,0][$y$,90]
\pscustom[fillstyle=solid,fillcolor=blue!40,opacity=0.4,linecolor=red,linestyle=none]{%
\psline(0,0)(-5,0)\psTDist[nue=#1]{-5}{5}
\psline(5,0)(0,0)}\psTDist[nue=#1,linecolor=red,linewidth=1pt]{-5}{5}
\rput(3,0.3){$\nu = #1$}\end{pspicture}}

\begin{document}
\begin{center}
\begin{animateinline}[poster=first,controls,palindrome]{10}
\multiframe{50}{rA=0.02+0.02}{\studentT{\rA}}
\end{animateinline}
\captionof{figure}{Student’s $t$-distribution.}
\end{center}
\end{document}


All it displays in the generated pdf are the numbers but no axes and no graph and no animation.

Where did I go wrong?

• I think you have to compile like latex test ---> dvips test ---> ps2pdf test.ps test.pdf. pstricks on XeTeX is a subset of that on dvips. – Akira Kakuto Oct 10 '17 at 7:06
• Thanks @AkiraKakuto. It worked. But why does it not work in MikTex? – qzx Oct 10 '17 at 7:21
• MiKTeX ships with an old Ghostscript, as far as I know. animate requires gs-9.15 or newer (if going the dvips route). – AlexG Oct 17 '17 at 7:32

## 1 Answer

Documents with PSTricks graphics to be animated inside the animateinline environment must be built the standard way, that is, along the sequence of commands:

latex mydoc
latex mydoc
dvips mydoc
ps2pdf mydoc.ps


xelatex usually does not produce the desired result.