I know this issue has been discussed a lot in other topics, but most of them contain complex examples, from which I haven't been able to understand the solution. So I have the following code:


 \psline[linewidth=0.04cm](0.0,0.78)(1.98,-0.78) \end{pspicture} 

I keep getting the error message: Undefined control sequence. What am I doing wrong? (I'm using texmaker in ubuntu).

  • Are you using pdflatex or latex-dvips-ps2pdf or xelatex? – kiss my armpit Nov 4 '13 at 21:06
  • I'm using pdflatex – Steve Nov 4 '13 at 21:09
  • Did you compile it with pdflatex -shell-escape inputfilename.tex? – kiss my armpit Nov 4 '13 at 21:09
  • @Marienplatz It seems that the obtained line is the line of OP's activity. ;-) – Przemysław Scherwentke Nov 4 '13 at 21:33
  • I compiled it through texmaker with pdflatex, don't know how to use -shell-escape in that. – Steve Nov 4 '13 at 22:20

Viewing this answer may help you.

To keep this answer short.

  • You can either use xelatex instead of pdflatex. In this case you should remove the [pdf] option from the pstricks package.
  • Or you can use pdflatex with the modification proposed in a previous comment or the afforementioned link. To do that you should go to the tab shown in the image.

    texmaker preferences tab

    On this tab you should modify the command for pdfLatex from pdflatex -interaction=nonstopmode %.tex to pdflatex -interaction=nonstopmode -shell-escape %.tex.

    My understanding is that this will create some PDF files with the images. I don't know if they are automatically being merged to the rest of the document though.

If you don't really need pdflatex for a spefic reason, other than pstricks, then I would suggest changing to xelatex. In my opinion it provides a "cleaner" approach to the matter.

I hope this helps.


insert the option --shell-escape into your configuration for pdflatex/latex/xelatex:

enter image description here

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.