[Tex/LaTex] How to use PSTricks in pdfLaTeX

auto-pst-pdfpdftexpstricks

I thought that PSTricks package was not possible to use in pdfLaTeX but the user Dima claims otherwise.

How can I force pdfLaTeX to use PSTricks then?

Best Answer

The easiest way is running xelatex instead of pdflatex. It detects itself PostScript code or eps images in the document and does the conversion on the fly. If you do not want to use xelatex then there are other solutions:

If you have an up-to-date TeX distribution use

\usepackage[pdf]{pstricks}

and then run your document with pdflatex -shell-escape <file>. Then the PSTricks images are created on-the-fly as stand alone pdf images and saved in <file>-pics.pdf. If you have an older system use

\usepackage{auto-pst-pdf}
\usepackage{pst-...}

For more information see PSTricks web page

For Windows you have to install a Perl version, if you want to use the full power of the auto-pst-pdf package. However, if you do not want or cannot install Perl then use

\usepackage[crop=off]{auto-pst-pdf}

There is also a Perl script pst2pdf which can create the document with pdflatex and also the PSTricks images as pdf|png|whatever images. It takes the preamble of the main document and creates stand-alone-documents for all PostScript specific code.

Related Question