# I can't compile code that use PSTRICKS

I'm having issues trying to compile code that use the package "pstricks". When I compile the next code (which can be found here) with Xelatex:

\documentclass[pstricks,crop]{standalone}
\usepackage{pst-optic}

\begin{document}

\begin{pspicture}(-8.5,-3)(8.5,3)
\rput(0,0){\lens[focus=3.333,OA=-10,AB=2,XO=2,xLeft=-8.5,xRight=8.5,rayColor=red]}
\end{pspicture}

\end{document}


I should have got the next output:

but instead, I always get the next one:

Then, when I try to compile other codes that also need the use of the package "pstricks" using Dvi -> PS and after that PS-> PDF I got warnings from Texmaker saying that:

MikTex GPL Ghostscript

9.19: ****Could not open the file output.pdf

• I have no problem here with up-to-date TL2018 and xelatex. Try to use an external editor and not the Built-in Viewer of TeXMaker. This can be changed in the lower right of your config image. – user2478 May 27 '18 at 19:54