1

I am having trouble installing and using pst-optex package. I went through the documentation installed all the prerequisites. But my tex comiler(TeXMaker) keeps giving errors. The code I have written is a simple example code from its documentation.

\documentclass[pstricks]{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}[showgrid](0,-0.3)(3,2.3)
\pnodes(0,1){A}(3,1){B}
\lens(A)(B)
\end{pspicture}
\end{document}

I get a undefined control sequence error at the line \begin{psp....

Could someone tell me what I could be missing of if there is a exhaustive material on this point me towards that. Thank you.

1 Answer 1

1

first check that you run xelatex and not pdflatex. Then:

for MikTeX: Go into the package manager (via the start button->MikTeX) and install pst-optexp

for TeXLive: do the same as for MikTeX or install it from the terminal: tlmgr install pst-optexp

3
  • 1
    Happy New Year! Note though, that xelatex doesn't work with pst-optexp's beam tracing, but requires dvips -> ps2pdf. I have no idea what exactly goes wrong, or how to fix that :(
    – Christoph
    Jan 1, 2016 at 13:51
  • @Christoph: send me an example which doesn't work.
    – user2478
    Jan 1, 2016 at 14:43
  • It's example 3 in Understanding beams in pst-optexp. That gives a ghostscript error when compiled with xelatex. I don't know how to debug such XeLaTeX problems.
    – Christoph
    Jan 2, 2016 at 11:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .