在 Windows 上使用 MikTex 的 pst-optexp

在 Windows 上使用 MikTex 的 pst-optexp

我正在尝试在 Windows 上使用 MikTex 绘制图表pst-optexp。每次我尝试使用 XeLatex 进行编译时,它都会抛出一个错误MiKTeX GPL Ghostscript 9.19: Unrecoverable error, exit code 1,所以我尝试了答案这里这并没有解决问题。我尝试使用建议这里但我找不到它引用的文件。下面是一个演示该问题的示例。我该怎么办?

\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}

答案1

您正在使用节点名称,例如(L),但未定义任何内容,\pnode 请查看文档以获取示例或使用坐标:

\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}

相关内容