When I try to compile a simple example using pgfplots, which require gnuplot, found here: http://www.texample.net/tikz/examples/gnuplot-basics/, TeXstudio gives the following messages:
Process started: pdflatex.exe -synctex=1 -interaction=nonstopmode -shell-escape "squareloss".tex 'gnuplot' is not recognized as an internal or external command, operable program or batch file. 'gnuplot' is not recognized as an internal or external command, operable program or batch file. 'gnuplot' is not recognized as an internal or external command, operable program or batch file. Process exited normally
and when I look in the generated pdf I see the grid, the axis and the lables but not the curves.
Gnuplot is in my PATH and I can run it both from Git Bash and from the Command Prompt (cmd) by simply entering "gnuplot
". I have also restarted the computer after it was added to the PATH (which it was by the Gnuplot installer).
I can compile the tex file from Git Bash with the same command TeXstudio tries to use, but not from cmd. However, cmd doesn't tell me that it can't find gnuplot, so it seems that it's only TeXstudio that can't find gnuplot. (Instead, cmd writes this in my log file:
Package pgf Warning: Plot data file `squareloss.x.table' not found. on input li ne 19.
so I still have to figure out why I can't use cmd to compile the document.)
I'm using Windows 10 and MiKTeX.
Help -> Check LaTeX Installation
Does the path to gnuplot appear in PATH?
Yes, but I noticed that the Gnuplot installed had inserted an extra "
;
" right before the path to Gnuplot. I removed the semicolon, restarted TeXstudio and then it worked! Thanks! (I still can't compile fromcmd
for some reason, but hey, who cares!)Huh, I realized that I had forgot to restart
cdm
after correctingPATH
. After a restart, I could compile the document fromcdm
as well.