I'd like to use pstricks with auto-pst-pdf. However, running the example code on http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput#autopstpdf gives me the following error:

Package auto-pst-pdf Warning:
    Could not create document-pics.pdf. Auxiliary files not deleted.
This warning occured on input line 124.

This is the input





  \rput(-4.5,4.5){A} \rput(4.5,4.5){B}

% \includegraphics{foo}% can be foo.jpg or foo.png


This is the output:

Z:\>pdflatex -shell-escape C:\Daten-Privat\mjira\workspace\test\document.tex
This is pdfTeX, Version 3.1415926-1.40.11 (MiKTeX 2.9)
entering extended mode
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
("C:\Programme\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Programme\MiKTeX 2.9\tex\latex\base\size12.clo"))
("C:\Programme\MiKTeX 2.9\tex\latex\pstricks\pstricks.sty"
>>> Loading package auto-pst-pdf <<<
("C:\Programme\MiKTeX 2.9\tex\generic\pstricks\pstricks.tex"
("C:\Programme\MiKTeX 2.9\tex\generic\xkeyval\pst-xkey.tex"
("C:\Programme\MiKTeX 2.9\tex\latex\xkeyval\xkeyval.sty"
("C:\Programme\MiKTeX 2.9\tex\generic\xkeyval\xkeyval.tex"
("C:\Programme\MiKTeX 2.9\tex\generic\xkeyval\keyval.tex"))))
("C:\Programme\MiKTeX 2.9\tex\generic\pstricks\pst-fp.tex"
`pst-fp' v0.05, 2010/01/17 (hv))
`PSTricks' v2.13  <2010/11/01> (tvz)
("C:\Programme\MiKTeX 2.9\tex\generic\pstricks\pstricks.con"))
("C:\Programme\MiKTeX 2.9\tex\generic\pstricks\pst-fp.tex")
("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\latex\xco
lor\xcolor.sty" ("C:\Programme\MiKTeX 2.9\tex\latex\00miktex\color.cfg")
("C:\Programme\MiKTeX 2.9\tex\latex\pdftex-def\pdftex.def"))) (Z:\document.aux)

("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\latex\aut
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty")
("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\latex\ifp
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\pdftexcmds.sty"
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\infwarerr.sty")
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\ifluatex.sty")
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\ltxcmds.sty"))
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\catchfile.sty"
("C:\Programme\MiKTeX 2.9\tex\generic\oberdiek\etexcmds.sty")))" "
"auto-pst-pdf: Auxiliary LaTeX compilation"

Package auto-pst-pdf Warning:
    Could not create document-pics.pdf. Auxiliary files not deleted.
This warning occured on input line 124.

"auto-pst-pdf: End auxiliary LaTeX compilation"

("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\latex\pst
-pdf\pst-pdf.sty" ("C:\Programme\MiKTeX 2.9\tex\latex\graphics\graphicx.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\graphics\graphics.sty"
("C:\Programme\MiKTeX 2.9\tex\latex\graphics\trig.sty")
("C:\Programme\MiKTeX 2.9\tex\latex\00miktex\graphics.cfg")))
("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\latex\pre
Preview: Fontsize 12pt
Preview: PDFoutput 1
) ("C:\Programme\MiKTeX 2.9\tex\latex\graphics\dvips.def")
("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\latex\env
("C:\Dokumente und Einstellungen\mjira\anwendungsdaten\MiKTeX\2.9\tex\context\b
[Loading MPS to PDF converter (version 2006.09.02).]

Package pst-pdf Warning: pspicture No. 1 undefined.

Package pst-pdf Warning: File `document-pics.pdf' not found.
(pst-pdf)                Use the following commands to create it:
(pst-pdf)                ----------------------------------------------------
(pst-pdf)                latex document.tex
(pst-pdf)                dvips -o document-pics.ps document.dvi
(pst-pdf)                ps2pdf document-pics.ps
(pst-pdf)                ---------------------------------------------------- .

(Z:\document.aux) )
No pages of output.
Transcript written on document.log.

(Strawberry-)Perl is installed:

Z:\>perl -v

This is perl 5, version 12, subversion 3 (v5.12.3) built for MSWin32-x86-multi-t

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

Have you got an idea what to check?

  • 1
    do you have the program pdfcrop? You can try to run it with usepackage[crop=off]{auto-pst-pdf. However, you can run xelatex instead and then you do not nueed auto-pst-pdf
    – user2478
    Aug 17, 2011 at 10:04
  • works with usepackage[crop=off]{auto-pst-pdf}! Strange, pdfcrop is installed referring to MikTeX... Thank you for your help! Great you are present on every LaTeX-Forum on the internet!
    – Marcel
    Aug 17, 2011 at 10:13

1 Answer 1


If you want all PSTricks code to be imported from within the TeX main input file, then it will be better using xelatex than using pdflatex +auto-pst-pdf. There are many limitations of using pdflatex + auto-pst-pdf. I will list the details in the next edit.

If you want some PSTricks code to be imported in the TeX main input file and the remaining PSTricks code to be converted to PDF images, then use xelatex + preview package.

If your PSTricks code

  • makes use of \label as in the following example:

  • or imports an image of type PNG, PDF, JPG as in the following example:

  • or works together with animate package as in the following example:


then pdflatex -enable-write18 + auto-pst-pdf cannot be used to produce the correct result.

The solution: use xelatex instead but it runs very very slowly if you compile the whole input files. To speed up the compilation, you should divide the your input file into several sub-files. Put each of "independent" PSTricks fragment into a separate input file and compile it to produce a single PDF output.

Note: An independent PSTricks fragment is a PSTricks code that does not belong to the 3 cases mentioned above.

An example of an "independent" PSTricks fragment:

% frame.tex

% preview must come after any pstricks package!

% Either
% or


Compile it with xelatex (slower than the snail) or latex-dvips-ps2pdf (faster than the light) and you will get frame.pdf.

Later, you can import the frame.pdf from within your main input file as follows:

% main.tex



Once again, compile the main input file using xelatex only. But compilation becomes faster! Note: latex-dvips-ps2pdf cannot import PDF images, that is why you have to use xelatex only!

NOTE: The main input file must NOT load preview package if you load animate package. Practically, you never need to load preview in the main input file, only sub-files need preview.

  • for 3D animations it it much more faster to use pst-pdf and then import the created pdf as \animategraphics[controls,loop]{5}{Animate-pics}{}{}.
    – user2478
    Aug 17, 2011 at 11:47
  • @Herbert: Are you sure the PDF animations produced by pst-pdf will still work if they are imported in the main input file? In my experience, PDF animation files will no longer work if they are imported in the main input file. That is why the raw PSTricks code that corresponds to the animation must be inserted to the main input file and recompiled together with the main input file. Aug 17, 2011 at 11:56
  • @xport: latex.userpage.fu-berlin.de/animate.pdf
    – user2478
    Aug 17, 2011 at 12:03

You must log in to answer this question.

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