While scrolling through the most popular questions i found this one: Nice scientific pictures show off. I tried compiling some of the scientific illustrations provided. Found that those that included pstricks gave me exactly the same error.

For example:

Compiling Electric field due to 3 charges gave me the following error:

enter image description here

After some digging, found some answers here: Undefined control sequence in basic pstricks work.

Went to the Menu > Options > Configure Texmaker > TeX commands tab, wrote in the pdflatex line: pdflatex -synctex=1 -shell-escape -interaction=nonstopmode %.tex. Still i could not compile the file without getting the same error.

Also tried compiling with LaTex+dvips+ps2pdf+Viewpdf This time I got a pdf file of 24 pages, that included 24 instances of the animation.

Any suggestions?

  • What is your actual question here? If it references an error during compilation, then it's a duplicate of PSTricks error "Undefined control sequence <recently read> \c@lor@to@ps". If it reference the fact that you want an animation (GIF) as output, then it's a duplicate of How to convert pstricks animation to GIF file? Either way, it seems to be a duplicate of something. – Werner Jan 2 '18 at 7:34
  • I didn't ask about the undefined control sequence error. I am aware it has already been answered. My question was why compiling with -shell-escape didn't work as it was supposed to. And if there is a way to produce the animation without using external software. So I dont think my question is an exact dublicate of another. – chadoulis Jan 2 '18 at 8:16

You get 24 pages which can then be later converted to an animation with a program like convert. However, this one can be run with pdflatex --shell-escape <file> and you'll get only one page:


    \psElectricfield[Q={[-1 3 0 PtoC][1 1 1][1 -1 -1]},linecolor=red]

enter image description here

| improve this answer | |

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.