1

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?

2
  • 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, 2018 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, 2018 at 8:16

1 Answer 1

2

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:

\documentclass{article}
\usepackage{pst-electricfield}
\usepackage{auto-pst-pdf}

\begin{document}
\begin{pspicture*}(-4,-4)(4,4)
    \psElectricfield[Q={[-1 3 0 PtoC][1 1 1][1 -1 -1]},linecolor=red]
\end{pspicture*}
\end{document}

enter image description here

2

You must log in to answer this question.

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