# Miktex pdflatex no longer compiles pstricks commands

I have been using MikTex 2.9's pdflatex for several years with sample code similar to:

 \documentclass{standalone}
\usepackage[pdf]{pstricks}
\usepackage{pst-all}
\begin{document}
\psset{xunit=1cm}
\begin{pspicture}(0,0)(4, 4)
\psaxes{-}(0,0)(0,0)(4,4)[$x$,0][$y$,0]
\end{pspicture}
\end{document}


That would generate a stand-alone PDF file that I would then bring into a main document with \includegraphics.

After a recent update (and then clean re-install) of MikTex 2.9 though, this code no longer compiles. The compiling output is essentially identical to the original compiling that works, until these errors are triggered:

<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmmi10.pfb>
<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr10.pfb>
[1]
Error: /typecheck in --div--
Operand stack:
1   0   0.0   TeXcolorgray   65781.8
Execution stack:
%interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --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--   5   --nostringval--   %repeat_continue   --nostringval--
Dictionary stack:
--dict:1169/1684(ro)(G)--   --dict:0/20(G)--   --dict:167/200(L)--   --dict:180/300(L)--
Current allocation mode is local
Current file position is 174298
MiKTeX GPL Ghostscript 9.05: Unrecoverable error, exit code 1
PDFCROP 1.38, 2012/11/02 - Copyright (c) 2002-2012 by Heiko Oberdiek.

!!! Warning: Empty Bounding Box is returned by Ghostscript!
!!!   Page 1: 0 0 0 0
!!! Either there is a problem with the page or with Ghostscript.
!!! Recovery is tried by embedding the page in its original size.

==> 1 page written on sample-pics.pdf'.
"-------------------------------------------------"
"auto-pst-pdf: End auxiliary LaTeX compilation"
"-------------------------------------------------"


and then later,

 (C:\Users\aableson\AppData\Roaming\MiKTeX\2.9\tex\context\base\supp-pdf.mkii
)
! Undefined control sequence.

l.7 \psaxes{-}(0,0)(0,0)(4,4)[$x$,0][$y$,0]

? OK, entering \batchmode


Summary: For over a year, MikTeX's pdflatex compiled the above file with no problems, and generated a usable PDF. Now, with a new install of MikTeX, pdflatex no longer compiles. [File still compiles on a computer with an older installation]

Command used for both: pdflatex --enable-write18 sample.tex

Any suggestions for what has changed and how to fix this would be welcome. I would be open, under duress, to developing a new workflow with xetex or one of the other tools, but I would strongly prefer something that goes from emacs editing to a PDF in one step. Thanks,

Alan

I've had the same problem for a few months. Something must have changed in pstricks. My solution was to remove the pdf option, and replace it with what the option does: loading auto-pst-pdf after pstricks.

• Thanks @Bernard for the suggestion; I just came across the following comment on another post ([link]tex.stackexchange.com/questions/70664/…). They indicated \usepackage{pstricks,auto-pst-pdf} bold, while my original \usepackage[pdf]{pstricks} \usepackage[pdf]{pstricks} no longer does. I changed to the one-line pstricks,auto-pst-pdf and everything seems to be back up and running. – Alan Ableson Nov 10 '15 at 23:53

With the standalone class your example fails with another error due to a option clash with preview. With article I can reproduce your error and it is due to a bug in pstricks: There are too many braces and so it loads auto-pst-pdf in a group. One can demonstrate the problem with this code:

\documentclass{article}
\usepackage{pstricks}
{\usepackage{auto-pst-pdf}}
\usepackage{pst-all}

\begin{document}
\psset{xunit=1cm}
\begin{pspicture}(0,0)(4, 4)
\psaxes{-}(0,0)(0,0)(4,4)[$x$,0][$y$,0]
\end{pspicture}
\end{document}


You should make a bug report.

• Thanks @ulrike-fischer: I'll try to follow up with a bug report to the MikTex group. – Alan Ableson Nov 10 '15 at 23:57
• It is not a miktex bug, you should write the pstricks maintainer. I dropped him a mail. – Ulrike Fischer Nov 11 '15 at 8:11
• Thanks Ulrike - I've never quite internalized the Byzantine relationships in the package/software hierarchy for TeX/LateX, so I appreciate you sending the bug report in the right direction. - Alan – Alan Ableson Nov 11 '15 at 15:09

it makes no real sense to use documentclass standalone together with package auto-pst-pdf. Both will run latex in the background. However, there are some special cases for loading auto-pst-pdf from within pstricks which make things complecated. I created a new file pstricks-pdf which makes it easier to load auto-pst-pdf. It should be available for tomorrows update for TeXLive. Until the use:

\documentclass[border=10pt]{standalone}
\usepackage{auto-pst-pdf}
\usepackage{pst-all}
\begin{document}
\psset{xunit=1cm}
\begin{pspicture}(0,0)(4, 4)
\psaxes(0,0)(0,0)(4,4)[$x$,0][$y$,0]
\end{pspicture}
\end{document}

• It doesn't compile without error for me with standalone class, I get an option clash error for preview. \documentclass[border=10pt,crop]{standalone} seems to work. – Ulrike Fischer Nov 12 '15 at 13:45
• do not use the pstricks option for standalone – user2478 Nov 12 '15 at 14:00
• \documentclass[border=10pt]{standalone} gives ! LaTeX Error: Option clash for package preview. too. One needs either the option preview=false or crop to avoid that standalone loads prewiev with other options than auto-pst-pdf. And only the option crop gives a "cropped" image. – Ulrike Fischer Nov 12 '15 at 14:08
• I cannot see it with up-to-date TL and pstricks-sty` version 0.61 (CTAN) – user2478 Nov 12 '15 at 14:13
• I found the source of the problem: I had a local standalone.cfg in the test folder and it prevented the loading of the default cfg (which would set the crop option) – Ulrike Fischer Nov 12 '15 at 14:28