So, I'm having some trouble with pst-optexp
lately. There seems to be some compilation problems with my sketch, since it doesn't show the elements properly. My current code is
\documentclass{standalone}
\usepackage{pstricks-add}
\usepackage{pst-optexp}
\let\clipbox\relax
\begin{document}
\begin{pspicture}[showgrid](0,-0.3)(9,2.3)
\pnode(1.8,1){A}\pnode(4.5,1){B}\pnode(7,1){C}\pnode(8,1){D}
\begin{optexp}
\optbox[position=start, labeloffset=0](A)(B){Fonte}
\lens[n=1.3, lensradius=-1 -1, lensheight=1](A)(B)
\lens[n=2, lensradius=2 2, lensheight=2](B)(C)
\pinhole[position=end, innerheight=0, outerheight=1.5](B)(D)
\drawwidebeam[beamwidth=0.3,fillstyle=solid, fillcolor=green!40](A){2-3}(D)
\end{optexp}
\end{pspicture}
\end{document}
This code yields the following result (when compiled with XeLaTeX on Overleaf v2):
If I remove the optexp
environment, i.e., use the following code:
\documentclass{standalone}
\usepackage{pstricks-add}
\usepackage{pst-optexp}
\let\clipbox\relax
\begin{document}
\begin{pspicture}[showgrid](0,-0.3)(9,2.3)
\pnode(1.8,1){A}\pnode(4.5,1){B}\pnode(7,1){C}\pnode(8,1){D}
\optbox[position=start, labeloffset=0](A)(B){Fonte}
\lens[n=1.3, lensradius=-1 -1, lensheight=1](A)(B)
\lens[n=2, lensradius=2 2, lensheight=2](B)(C)
\pinhole[position=end, innerheight=0, outerheight=1.5](B)(D)
\drawwidebeam[beamwidth=0.3,fillstyle=solid, fillcolor=green!40](A){2-3}(D)
\end{pspicture}
\end{document}
I have dealed with similar issues on other PSTricks diagrams, which seemed to compiled when put in certain pages of the document, but were breaking in other places. How can I solve this?
I'm sorry if this is a known issue or something alike, I've been searching the web for quite sometime now and I just couldn't find a solution. Also, please let me know if there are bad style issues in this post, I have asked few questions over here so far.