2

I used to make animated pictures using pstricks and the beamer overlay syntax (eg. using \only<2>{<some pstricks code>}) with the standalone class.

Here a MWE which did the work:

\documentclass[beamer,pstricks,preview=true]{standalone}

\standaloneenv{{pspicture}}

\psset{unit=2cm}
\begin{document}
\begin{standaloneframe}
  \begin{pspicture}[showgrid=bottom](-5,-5)(5,5)
    \psdot(0,0)
    \only<2>{\psdot(1,1)}
  \end{pspicture}
\end{standaloneframe}
\end{document}

This MWE does compile with texlive2013 (iso-version) with latex -> dvips -> ps2pdf: a pdf with two pages and just the pspictures environment correctly croped. HOWEVER it does not compile with a fully updated texlive2013 distribution, the conversion from ps to pdf fails with the following message:

Error: /typecheck in --div--
Operand stack:

   1   1   0.0   0.0   a   65781.8

Execution stack:

   %interp_exit   .runexec2   --nostringval--   --nostringval--   
--nostringval--   2   %stopped_push   --nostringval--   --nostringval--   
--nostringval--   false   1   %stopped_push   1910   1   3   %oparray_pop   
1909   1   3   %oparray_pop   1893   1   3   %oparray_pop   1787   1   3   
%oparray_pop   --nostringval--   %errorexec_pop   .runexec2   
--nostringval--   --nostringval--   --nostringval--   2   %stopped_push   
--nostringval--   --nostringval--   --nostringval--   --nostringval--   4   
--nostringval--   %repeat_continue   --nostringval--

Dictionary stack:

   --dict:1168/1684(ro)(G)--   --dict:0/20(G)--   --dict:127/200(L)--   
--dict:173/300(L)--

Current allocation mode is local

Last OS error: 2

Current file position is 101382

GPL Ghostscript 9.05: Unrecoverable error, exit code 1

This code does compile by removing the preview package but the result is not what is expected. I also tried to active preview with the option of the standalone package but this is also without effect.

Does someone know how to resolve this problem, or how to modify the MWE so that it compiles and give the right output ?

2
  • Why do xou need the standalone class for the presentation?
    – user2478
    May 22, 2014 at 7:10
  • It's not for a presentation, I use this combination to create animated pictures without needing to copy the whole body for each picture. But now that you say it, I may actually not have to use the standalone class to do it.
    – Adam B.
    May 22, 2014 at 7:18

1 Answer 1

2

So, after a lot of try and errors, I've couldn't find out why this code no longer works with an updated TexLive distribution. However I've found a workaround.

It seems that somehow the preview package and pstricks do not come along together anymore. So the workaround is to deactivate the preview option of the standalone package. That way there is no compilation errors anymore, but the result is not what is expected. Indeed the standaloneframe environment kind of override the directive \standaloneenv{{pspicture}} so that the crop is done to the dimensions of the standaloneframe and not to the dimensions of the pspicture. Using the geometry package allows to set the dimensions of the standonealoneframe so that they match the dimensions of the pspicture resolves the problem:

\documentclass[beamer,pstricks,preview=false]{standalone}

\geometry{paperheight=20cm,paperwidth=20cm,left=0cm,right=0cm,bottom=0cm,top=0cm}

\psset{unit=2cm}
\begin{document}
\begin{standaloneframe}%
  \begin{pspicture}[showgrid=bottom](-5,-5)(5,5)
    \psdot(0,0)
    \only<2>{\psdot(1,1)}
  \end{pspicture}%
\end{standaloneframe}
\end{document}
1
  • This hack with \geometry may not be the best solution. May 21, 2021 at 19:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .