I just received a new macbook OS 10.8 Mountain Lion and I have installed TeXmaker, MacTex, MacPorts and gnuplot. I compiled a LateX file that uses TikZ and gnuplot and got the following error in the logfile. TeXMaker also stalls after the compile attempt and a force quit is required to close the app.

Versions: TeXMaker 4.0.2 Gnuplot 4.6 patchlevel 3

Package gnuplottex Warning: Shell escape not enabled. 
You'll need to convert the graphs yourself..

I have already added the following to the TeXmaker preferences:

"/usr/texbin/pdflatex" --shell-escape --enable-write 18 -synctex=1 -interaction=nonstopmode %.tex

So I tried adding gnuplot to my PATH

echo $PATH 



I tried running the following example in TeXworks and got the same plot error.

%& -shell-escape
% Source: The PGF/TikZ manual


% GNUPLOT required

\draw[very thin,color=gray] (-0.1,-1.1) grid (3.9,3.9);
\draw[->] (-0.2,0) -- (4.2,0) node[right] {$x$};
\draw[->] (0,-1.2) -- (0,4.2) node[above] {$f(x)$};
\draw[color=red] plot[id=x] function{x} 
    node[right] {$f(x) =x$};
\draw[color=blue] plot[id=sin] function{sin(x)} 
    node[right] {$f(x) = \sin x$};
\draw[color=orange] plot[id=exp] function{0.05*exp(x)} 
    node[right] {$f(x) = \frac{1}{20} \mathrm e^x$};


Warning/error below, the plot looks empty. Yes, I have gnuplot installed. 
Package pgf Warning: Plot data file 'test2.x.table' not found. on input line
Package pgf Warning: Plot data file 'test2.sin.table' not found. on input line
Package pgf Warning: Plot data file 'test2.exp.table' not found. on input line

.log file for running on TeXMaker:

This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) (format=pdflatex     2012.6.30) 16 MAY 2013 23:28
entering extended mode
\write18 enabled.
%&-line parsing enabled.
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation,  ge
rman-x-2012-05-30, ngerman-x-2012-05-30, afrikaans, ancientgreek, ibycus,  arabi
c, armenian, basque, bulgarian, catalan, pinyin, coptic, croatian, czech, danis
h, dutch, ukenglish, usenglishmax, esperanto, estonian, ethiopic, farsi, finnis
h, french, friulan, galician, german, ngerman, swissgerman, monogreek, greek, h
ungarian, icelandic, assamese, bengali, gujarati, hindi, kannada, malayalam, ma
rathi, oriya, panjabi, tamil, telugu, indonesian, interlingua, irish, italian,
kurmanji, latin, latvian, lithuanian, mongolian, mongolianlmc, bokmal,  nynorsk,
polish, portuguese, romanian, romansh, russian, sanskrit, serbian, serbianc, s
lovak, slovenian, spanish, swedish, turkish, turkmen, ukrainian, uppersorbian,
welsh, loaded.
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
File: size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option) 
Package: gnuplottex 2011/09/12 v0.4.4 gnuplot graphs in LaTeX
Package: latexsym 1998/08/17 v2.2e Standard LaTeX package (lasy symbols)
LaTeX Font Info: Overwriting symbol font `lasy' in version `bold'
(Font) U/lasy/m/n --> U/lasy/b/n on input line 47.
Package: graphicx 1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
Package: keyval 1999/03/16 v1.13 key=value parser (DPC)
Package: graphics 2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
Package: trig 1999/03/16 v1.09 sin cos tan (DPC)
File: graphics.cfg 2010/04/23 v1.9 graphics configuration of TeX Live  
Package graphics Info: Driver file: pdftex.def on input line 91.
File: pdftex.def 2011/05/27 v0.06d Graphics/color for pdfTeX
Package: infwarerr 2010/04/08 v1.3 Providing info/warning/error messages (HO)
Package: ltxcmds 2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
Package: moreverb 2008/06/03 v2.3a `more' verbatim facilities
Package: verbatim 2003/08/22 v1.5q LaTeX2e package for verbatim enhancements
Package: ifthen 2001/05/26 v1.1c Standard LaTeX ifthen package (DPC)
runsystem(echo t > "w18-test-20135161408")...executed.
runsystem(del "w18-test-20135161408")...executed.
Package gnuplottex Warning: Shell escape not enabled.
(gnuplottex) You'll need to convert the graphs yourself..
) (./test.aux)
\openout1 = `test.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6. 
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 6.
LaTeX Font Info: ... okay on input line 6.
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2012/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty
Package: pdftexcmds 2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX     (HO
Package: ifluatex 2010/03/01 v1.3 Provides the ifluatex switch (HO)
Package ifluatex Info: LuaTeX not detected.
Package: ifpdf 2011/01/30 v2.3 Provides the ifpdf switch (HO)
Package ifpdf Info: pdfTeX in PDF mode is detected.
Package pdftexcmds Info: LuaTeX not detected.
Package pdftexcmds Info: \pdf@primitive is available.
Package pdftexcmds Info: \pdf@ifprimitive is available.
Package pdftexcmds Info: \pdfdraftmode found.
Package: epstopdf-base 2010/02/09 v2.5 Base part for package epstopdf
Package: grfext 2010/08/19 v1.1 Manage graphics extensions (HO)
Package: kvdefinekeys 2011/04/07 v1.3 Define keys (HO)
Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO)
Package: kvsetkeys 2012/04/25 v1.16 Key value parser (HO)
Package: etexcmds 2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
Package etexcmds Info: Could not find \expanded.
(etexcmds) That can mean that you are not using pdfTeX 1.50 or
(etexcmds) that some package has redefined \expanded.
(etexcmds) In the latter case, load this package earlier.
Package grfext Info: Graphics extension search list:
(grfext) [.png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,.PNG,.PDF,.JPG,.JPE
(grfext) \AppendGraphicsExtensions on input line 452.
File: epstopdf-sys.cfg 2010/07/13 v1.3 Configuration of (r)epstopdf for TeX       Liv
\openout3 = `test-gnuplottex-fig1.gnuplot'.
Opening gnuplot stream test-gnuplottex-fig1.gnuplot
Package gnuplottex Warning: Please convert test-gnuplottex-fig1.gnuplot     manuall
\openout3 = `test-gnuplottex-fig2.gnuplot'.
Opening gnuplot stream test-gnuplottex-fig2.gnuplot
Package gnuplottex Warning: Please convert test-gnuplottex-fig2.gnuplot    manuall
(./test.aux) )
Here is how much of TeX's memory you used:
1637 strings out of 493488
24017 string characters out of 3141326
75347 words of memory out of 3000000
4946 multiletter control sequences out of 15000+200000
3640 words of font info for 14 fonts, out of 3000000 for 9000
957 hyphenation exceptions out of 8191
37i,1n,23p,237b,70s stack positions out of 5000i,500n,10000p,200000b,50000s
No pages of output.
PDF statistics:
0 PDF objects out of 1000 (max. 8388607)
0 named destinations out of 1000 (max. 500000)
1 words of extra memory for PDF output out of 10000 (max. 10000000)
  • welcome to tex.sx. You can format code sections by indenting by 4 spaces (or highlight then use the {} button. Inline code can be marked with backticks: abc. – David Carlisle May 15 '13 at 23:47
  • 1
    -enable-write 18 should be -enable-write-18 with no space but it's the same thing as -shell-escape which you already have except it should have one - not two. does it work if you use that command directly on the terminal? Also are you sure texmaker is using pdflatex rather than (say) latex. What does the start or end of the log file say? (I don't have a mac so can't be too specific:-) – David Carlisle May 16 '13 at 0:05
  • Related question Gnuplot and PDFLatex question – texenthusiast May 16 '13 at 0:19
  • I added the file I tried to compile above. It compiles now but the plots are empty. Should I post the whole log file? – kjhudson May 17 '13 at 3:26
  • @kjhudson did the process make a file with the suffix .table? – dustin May 17 '13 at 3:26

I read your log file and it says you need to make the files manually.

I ran a test on my system since I haven't used gnuplot in a bit. I ran latex and the .gnuplot file was created like in your case.

Next, I ran in the terminal gnuplot /path/to/.gnuplot file(s). From here, gnuplot created two .tex files. When I used another system, it created table files. Upon reading the manual, it may produce depending on your system and settings eps, png, tex, table, and some others.

If it creates one of the files that can be used in includgraphics, you can do that. If you get .tex files, run latex again and the plots will appear. If you get a table, run latex again and the plots will appear.

  • Thank you for that tip! This problem only occurred when switching to my new computer. This worked fine on my older mac and I never had to compile the gnuplots my self. The only difference is moving from 10.5 operating system to 10.8 as well as newer versions {MacTex} and {gnuplot}. This would mean that all the documents I have written the past year an a half now have plots compiled by hand. That can't be right. I also don't know how to do that so I would you be so kind to step me through this so I can use it as a last resort that would be appreciated. – kjhudson May 17 '13 at 12:48
  • @kjhudson open the .gnuplot in gnuplot and run it. Once you open it in gnu, you should be easy to figure out. The files you have done before already have .tables so those are fine. You can using latexmk which runs pdflatex the appropriate amount of times to shore up issues like this. For instance, you run latexmk it generates the gnuplot and then runs again since it needs the table. – dustin May 17 '13 at 15:15
  • Ok, so I briefly saw this in the messages/log while the file was compiling: {sh : gnuplot command not found}. But when I type gnuplot into the terminal it runs. Also having trouble highlighting within the comments. – kjhudson May 17 '13 at 15:29
  • @kjhudson until you figure out how to get your latex setup to recognize gnuplot, you may have to do it manual which isn't that hard. Did you open your gnuplot files in gnuplot and generate the table? If so, run latex again. – dustin May 17 '13 at 15:33
  • In the terminal, I went to the folder where the .gnuplot file existed and typed in the file name. I got an error saying invalid command. How to I run the file? – kjhudson May 17 '13 at 15:39

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.