2

This question already has an answer here:

It seems that pst-optexp is not drawing the graphics associated with a drawing, only the text in it. Here is an example:

\documentclass{article}
\usepackage{filecontents}
\usepackage{pstricks}
\usepackage{pst-optexp}
\usepackage{physics}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{tikz}

\begin{document}

\begin{pspicture}(-0.3,0)(2,3.7)
\psset{labeloffset=1, optboxwidth=1, arrowscale=1.5, arrowinset=0}
\optbox[position=end, labelangle=90](1,1)(1,2){Box}
\beamsplitter[labelangle=-90](1,2)(1,1)(2,1){BS}
\drawbeam[arrows=->]{1}{2}(2,1)
\end{pspicture}

\end{document}

And here is what is displayed:

I am using MikTex on Windows in TexWorks, and compiling with XeLatex+MakeIndex+BibText.

marked as duplicate by Christoph, Mensch, Sebastiano, dexteritas, Phelype Oleinik Jul 11 '18 at 20:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • On my computer I do get the correct graphics with xelatex. Which viewer are you using? Which file are you viewing? (If you look at the dvi file, clearly pstricks graphics won't show.) – user121799 Nov 28 '17 at 0:24
  • I am using the default viewer in TeXWorks. I am viewing the PDF. – Billy Kalfus Nov 28 '17 at 17:39
  • I guess @Herbert is on the correct track. If you do not have all these style files, it is not too surprising that the compilation fails. – user121799 Nov 28 '17 at 17:50
  • Yeah, the problem is trying to figure out how to get these style files. – Billy Kalfus Nov 28 '17 at 17:52
  • They should be included in you TeX installation. – user121799 Nov 28 '17 at 18:10
2
\listfiles
\documentclass{article}
\usepackage{pst-optexp}  
\begin{document}

    \begin{pspicture}(-0.3,0)(2,3.7)
    \psset{labeloffset=1, optboxwidth=1, arrowscale=1.5, arrowinset=0}
    \optbox[position=end, labelangle=90](1,1)(1,2){Box}
    \beamsplitter[labelangle=-90](1,2)(1,1)(2,1){BS}
    \drawbeam[arrows=->]{1}{2}(2,1)
    \end{pspicture}

\end{document}

enter image description here

and the file list, which is at the end of your log file:

 This is XeTeX, Version 3.14159265-2.6-0.99998 (TeX Live 2017) (preloaded format=xelatex 2017.11.27)  28 NOV 2017 08:39
 [...]
 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
pst-optexp.sty    2014/11/26 v5.2 Optical experimental setups with PSTricks
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
pstricks.sty    2017/11/27 v0.66 LaTeX wrapper for `PSTricks' (RN,HV)
   iftex.sty    2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
 and LuaTeX
shellesc.sty    2016/06/07 v0.02a unified shell escape interface for LaTeX
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
   xetex.def    2017/06/24 v5.0h Graphics/color driver for xetex
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
pstricks.tex    2017/11/27 v2.79 `PSTricks' (tvz,hv)
  pst-fp.tex    2017/11/27 v2.79 `PST-fp' (hv)
pstricks.pro    2017/09/18 v. 1.27, PostScript prologue file (hv)
pst-algparser.pro    2011/10/31 v. 0.04, PostScript prologue file (hv)
pst-tools.pro    2013/10/26 v 0.04, PostScript prologue file
pst-dots.pro    2006/12/19 v. 2.00, PostScript prologue file (hv)
pst-xkey.sty    2005/11/25 v1.6 package wrapper for pst-xkey.tex (HA)
pst-node.sty    2010/04/22 package wrapper for pst-node.tex
pst-node.tex    2017/01/20 1.39 `pst-node' (tvz,hv)
pst-node.pro    2011/09/18 v. 1.14, PostScript prologue file (hv)
pst-plot.sty    2011/04/13 package wrapper for pst-plot.tex (hv)
 multido.sty    2004/05/17 package wrapper for PSTricks `multido.tex', (HV/RN)
 multido.tex    2010/05/14 v1.42 `multido' (tvz,hv)
pst-plot.tex    2017/11/16 1.86 `pst-plot' (tvz,hv)
pst-eucl.sty    2014/05/17 package wrapper for PSTricks pst-eucl.tex
pst-tools.sty    2012/01/01 package wrapper for pst-tools.tex (hv)
pst-tools.tex    2017/11/16 v1.86 `PST-tools' (hv)
pst-tools.pro    2013/10/26 v 0.04, PostScript prologue file
pst-eucl.tex    2017/04/18 v1.56 `PST-eucl' (dr,hv)
pst-eucl.pro    2012/09/21 v. 1.01, PostScript prologue file (hv)
pst-intersect.sty    2014/03/16 v0.4 package wrapper for pst-intersect.tex
pst-func.sty    2017/08/17 package wrapper for pst-func.tex (hv)
pst-math.sty    2014/07/30 package wrapper for PSTricks pst-math.tex
pst-math.pro    2014/07/30 v. 0.63, PostScript prologue file (hv)
pstricks-add.sty    2010/02/11 v. 0.14 package wrapper for pstricks-add.tex (hv
)
  pst-3d.sty    2009/07/28 package wrapper for pst-3d.tex (hv)
  pst-3d.tex    2017/04/18 v1.56 `PST-3d' (hv)
  pst-3d.pro    2010/01/01 v. 0.01, PostScript prologue file (hv)
pstricks-add.tex    2017/04/18 v1.56 `PSTricks-add' (hv)
pstricks-add.pro    2009/12/17 v. 0.23, PostScript prologue file (hv)
pst-func.tex    2017/08/24 v0.88 `PST-func' (hv)
pst-func.pro    2014/05/07 v. 0.16, PostScript prologue file (hv)
pst-intersect.tex
 environ.sty    2014/05/04 v0.3 A new way to define environments
trimspaces.sty    2009/09/17 v1.1 Trim spaces around a token list
pst-optexp.pro
  • It seems that I am missing iftex.sty, shellesc.sty, pstricks.pro,pst-algparser.pro, pst-dots.pro, pst-node.pro, pst-tools.pro, pst-eucl.pro, pst-math.pro` – Billy Kalfus Nov 28 '17 at 17:26
  • Looking in the log output, I found this too (and a bunch more like it): xdvipdfmx:warning: Unrecognized color name: gray, keep the current color xdvipdfmx:warning: Image format conversion for PSTricks failed. xdvipdfmx:warning: Interpreting special command PST: (ps:) failed. xdvipdfmx:warning: >> at page="1" position="(157.216, 562.316)" (in PDF) xdvipdfmx:warning: >> xxx "PST: tx@Dict begin gsave STV newpath /ArrowA { moveto } def /Ar" – Billy Kalfus Nov 28 '17 at 17:42
  • Is your MiKTeX up-to-date? – user2478 Nov 28 '17 at 18:09
  • Although you get some output, the result is wrong, as you can see from the wrong rotation of the beam splitter square frame relative to the reflection interface. Unfortunately, pst-optexp doesn't work properly with xelatex – Christoph Nov 28 '17 at 21:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.