# ! LaTeX Error: You have run the document with pdflatex, but PSTricks

! LaTeX Error: You have run the document with pdflatex, but PSTricksrequires latex->dvips->ps2pdf or alternatively the useof the package auto-pst-pdf'. Then you can runpdflatex -shell-escape ' (TeX Live)orpdflatex -enable-write18 ' (MikTeX).See the LaTeX manual or LaTeX Companion for explanation.Type H for immediate help.... \begin{document}

• All is said in the error message, you have some pstricks code that cannot be compiled by pdflatex alone. You must load the auto-pst-pdf package, and launch pdflatex with one of the mentioned switches. We can help more if you give some more details (which distribution do you have, which editor, &c.) Sep 16 '15 at 17:09
• You are using Sage-TeX. Instaed of running pdflatex use xelatex and everything should be fine.
– user2478
Sep 16 '15 at 17:34

I think the error message is pretty clear as it stands. The package PSTricks does not run with pdflatex without additional preparations (like including the package auto-pst-pdf and adding some operating system dependend compilation flag), but only with standard latex producing a dvi file. This dvi file is converted to a ps (PostScript) file with dvips. In a last step you can get a pdf file from the ps file running either ps2pdf or pstopdf (the latter two are two different programs producing different pdf files that should look the same on screen and on paper).

• You can compile with pdflatex if you load auto-pst-pdf`. Sep 16 '15 at 17:22
• @Bernard: OK, I rephrased my answer. My main aim in the answer was to guide the classical LaTeX-dvips-ps2pdf path. Sep 16 '15 at 17:26