[Tex/LaTex] Using [pdf]{pstricks} with beamer doesn’t work, but auto-pst-pdf does, why

auto-pst-pdfbeamerpstricks

\documentclass{beamer}

%\usepackage{pstricks,auto-pst-pdf} % works
\usepackage[pdf]{pstricks}
\usepackage{pst-tree}

\begin{document}
\begin{frame}{Test}
    \begin{postscript}
        $\pstree{\TR{S}}{}$
    \end{postscript}
\end{frame}
\end{document}

I get the following error:

Error: /typecheck in --div--
Operand stack:
   1   0   0.0   -0.00706883   a   65781.8
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostri
ngval--   --nostringval--   false   1   %stopped_push   1926   1   3   %oparray_pop   1925   1   3   %oparray_pop   1909   1   3
 %oparray_pop   1803   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:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:123/200(L)--   --dict:100/300(L)--
Current allocation mode is local
Current file position is 120580
MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1

I use MiKTeX 2.9 and latest packages in Windows 7.

Best Answer

with [pdf] the package auto-pst-pdf is loaded with \AtBeginDocument. This doesn't work with Beamer. However, I've forgotten why I used the late loading of the package with \AtBeginDocument. I'll see if I can fix it.

Edit: With current TeXLive from tomorrow it works now (or pstricks.sty from http://texnik.dante.de/tex/latex/pstricks/) . Don't know if this is also true for MikTeX

Related Question