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.


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.


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

  • 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 '16 at 13:51
  • @Christoph: send me an example which doesn't work. – user2478 Jan 1 '16 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 '16 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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