Many people writing scientific documents in TeX know the problem: on one hand, you want to use the more modern pdfTeX rather than LaTeX, for example because of the hyperref package or because you want to include pdf, png or jpg images. On the other hand, pdfTeX fails to produce figures that make use of PostScript, as is the case when using the very useful PSTricks. There are a number of possible ways around this problem. What is working well for me right now is a solution kindly provided by Wolfgang. Create PSTricks figures as separate documents using the following skeleton:
\documentclass{article}
\usepackage{pstricks}
\pagestyle{empty}
\begin{document}
% your graphics here
\end{document}
Then autocrop the document and save it as a PDF file using the following shell script:
#!/bin/sh latex $1.tex dvips $1.dvi ps2eps -l --nohires -f $1.ps ps2pdf -dEPSCrop -dAutoRotatePages=/None -dUseFlateCompression=true $1.eps
Then you can include the graphics (in PDF format) from your main document, which you build using pdfTeX.
Since I use Kile for writing in TeX, I replaced the shell script with a build tool which I called IlluTeX. It amounts to the following additions in ~/.kde/share/config/kilerc:
[Tool/IlluTeX/Default] autoRun=no checkForRoot=no class=Sequence close=no jumpToFirstError=no menu=Compile sequence=LaTeX,DVItoPS,PStoEPS,PStoPDFEPSCrop,ViewPDF state=Editor to=pdf type=Sequence [Tool/PStoEPS/Default] class=Convert close=no command=ps2eps from=ps menu=Compile options=-l --nohires -f '%S.ps' state=Editor to=eps type=Process [Tool/PStoPDFEPSCrop/Default] class=Convert close=no command=ps2pdf from=eps menu=Compile options=-dEPSCrop -dAutoRotatePages=/None -dUseFlateCompression=true '%S.eps' '%S.pdf' state=Editor to=pdf type=Process




