I was able to write a piece of code that drew a graph in gnuplot and then using tikz embedded that into my TeX document and run it via Texshop. I am not able to do that anymore. I need to run

pdflatex --shell-escape foo.tex

For my graphs to appear properly. Is there some setting I can enable in TexShop so I don't have to do this. I mean I want to be able to just hit type set from inside TexShop to do this. As I understand they have done away with the --shell-escape flag in TexShop because of security vulnerabilities.

Can anyone help?


You need to go to TeXShop/Preferences and add the --shell-escape option to the Engine tab as shown here:

enter image description here

After restarting TeXShop, selecting LaTeX from the pull down will automatically have the --shell-escape option enabled.

Alternatively you can also create you own .engine files. An example of this is at Problems with implementing glossary.engine in TeXShop. As egreg commented, with your own custom engine it is clear to you that are enabling --shell-escape, especially if you name it something like LaTeX w ShellEscape.

This will enable --shell-escape but you still need to ensure that you indded have gnuplot installed. As I mentioned in an earlier answer at Generating graphs with gnuplot (Gnuplot, LaTeX and tkz-fct) you should have a look at this gnuplot tutorial and ensure that gnuplot is working.

  • The alternative engine is, in my opinion, the best route. Just the warning is not sufficient as users tend to get annoyed and are tempted to disable it. Choosing the engine with active shell escape should be a conscious decision. – egreg Feb 9 '13 at 11:41
  • Well I did this but its still the same. The graphs don't get graphed. Also, what do you mean pull down?. I do not have an option for PdfLaTeX in my pull down. It has: Plain Tex, BibTeX, LaTeX etc. But not PdfLaTeX – minibuffer Feb 10 '13 at 18:27
  • @user54755: Yes it is LaTeX in TeXShop. Have corrected that. Also you need to make sure that you have gnuplot working -- see updated answer. – Peter Grill Feb 10 '13 at 18:37
  • @PeterGrill. Thanks so much for your help peter. Gnuplot does work. I checked from the command line and then running my gnuplot tex file using the command line with the command : pdflatex --shell-escape foo.tex. The graphs appear properly then. But when I try to use texshop to typeset it, the problem occurs. Thanks for your help. – minibuffer Feb 10 '13 at 18:40
  • @user54755 Did you restart TeXShop? If that does not resolve the issue don't know I can help without more info. Can you post a complete MWE of a sample file that runs. Also, check the log files, perhaps there is some information there. – Peter Grill Feb 10 '13 at 18:48

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.