Home Download Buy Blog Forum Support

Calling gnuplot from sb2 within LaTeX

Calling gnuplot from sb2 within LaTeX

Postby tcoake on Tue Feb 05, 2013 4:27 pm

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.
tcoake
 
Posts: 2
Joined: Tue Feb 05, 2013 4:19 pm

Re: Calling gnuplot from sb2 within LaTeX

Postby tom01 on Wed Feb 06, 2013 7:39 pm

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.
tom01
 
Posts: 1
Joined: Wed Feb 06, 2013 7:30 pm

Re: Calling gnuplot from sb2 within LaTeX

Postby tcoake on Mon Mar 04, 2013 6:33 pm

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.
tcoake
 
Posts: 2
Joined: Tue Feb 05, 2013 4:19 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 29 guests