2

I am trying to draw a diagram with pst-optexp in MikTex on Windows. Every time I try to compile using XeLatex, it would throw an error saying MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1, so I tried the answer here which did not resolve the issue. I tried using the advice here but I could not find the file it referenced. Below is an example that demonstrates the issue. What can I do?

\documentclass{article}
\usepackage{filecontents}
\usepackage{pstricks}
\usepackage[crop=off]{auto-pst-pdf}
\usepackage{pst-optexp}
\usepackage{physics}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{tikz}

\begin{document}

\begin{pspicture}
    \begin{optexp}
        \optbox[innerlabel, position=start](L)(End){$\ket{\psi_1}$}
        \beamsplitter[bssize=0.4, labelangle=-90](L)(L|C)(C){50/50 BS}
    \end{optexp}
\end{pspicture}

\end{document}
Christoph
  • 16,593
  • 1
  • 23
  • 47
Billy Kalfus
  • 143
  • 4

1 Answers1

2

You are using node names, eg (L) but didn't define any with \pnode Look into the documenation for an example or use coordinates:

\documentclass{article}
\usepackage{pstricks}
\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}