Sublime Forum

Calling gnuplot from sb2 within LaTeX

#1

The problem i’m having is calling gnuplot within the tikz environment. typically this is done automatically, but for one reason or other it doesn’t work in sb2. I’ve searched and can’t find others with the same problem, so any help is definitely appreciated. The problem specifically is when I plot a graph within a tikz environment, Latex will call gnuplot to do the graph and insert it into the picture; however, I don’t get any errors it simply just doesn’t output anything except the labels and axes that I defined.

0 Likes

#2

I do have the same problem with SB2. It does not call gnuplot for some reason. On the same MAC, textmate runs the same tex file without problems and calls gnuplot correctly that is it produces the *.table files.
In WB2 write18 is enabled (shell-escape) and it calls other shell commands. By the way: By opening a terminal window and calling gnuplot from there, gnuplot produces the *.table file and the plot can be included.

0 Likes

#3

Ok, found the solution! For one reason or other I didn’t think of this before but you have to enable -shell-escape or write-18, which is the same thing you have to do on any other editor. There is not an option to enable this within ST2, instead you must edit the file: LaTeX.sublime-build. The file is easiest to locate from within ST2 by going to Preferences -> Browse Packages-> LatexTools -> Latex.sublime-build and edit and save the file as follows:

“cmd”: “latexmk”, “-cd”,
“-e”, “$pdflatex = ‘pdflatex %O -interaction=nonstopmode -synctex=1 -shell-escape %S’”,
//"-silent",
“-f”, “-pdf”],

This has worked for me and I installed gnuplot via macports and used a symbolic link to usr/local/bin. I’m not sure if the link is necessary since I had done this earlier to get TeXshop to find gnuplot.

0 Likes