Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have recently discovered the TikZ packages for LaTeX: http://altermundus.com/pages/tkz/index.html

I have run the examples for tkz-euclide with success.

I would also like to use the tkz-fct package for plotting curves. Since I have not previously installed Gnuplot, when I compile examples using the tkz-fct package I get the error message: Plot data file `filename.tkzfct.table' not found.

I have read several web pages that describe how to compile the source for Gnuplot for Mac OSX and also some explanations on how to obtain binaries as part of other packages such as Octave and others. I have not tried these procedures yet, as they seam complicated and I am a novice at Mac OSX details.

What is the best practice for how to install Gnuplot for use with TexShop with MacTex 2012 distribution, on Mac OS-X 10.8.2 Mountain Lion for use with 'tkz-fct' package.

I apologize if a similar question was answered already, but there are so many different answers and many are a few years old.

share|improve this question
1  
See if the instructions here work (they should): How to use GNU Plot to plot diagrams in TeXShop. –  Alan Munn Jan 7 '13 at 5:15
    
I issued the command ./configure in the correct gnuplot-4.6.1 directory, but received the message, "configure: error: no acceptable C compiler found in $PATH", and make not found. I had read somewhere in another post, that I may have to get Developer account for MAC? It appears I need to install C compilers first. I have not installed these. What are the steps needed to install GNU C compilers if needed. –  user24058 Jan 7 '13 at 14:11
2  
You need to have the Developer Tools installed. Under Lion and later that means installing the Xcode app from the App Store (it's free) and installing the command line tools from within the appp. There's a nice summary of it here: Developer tools on OS X 10.7 –  Alan Munn Jan 7 '13 at 14:39
1  
I have now installed Xcode, and installed Command Lines, was then able to compile GNU Plot, verified gnuplot running at terminal. Then following instructions on TexLive2012Changes.pdf and Eps-Tiff-Conversion.pdf, Appendix B - Adding Programs to the Restricted Program List, I added gnuplot in the file texmf.cnf and followed instructions, But when I run the example in the post "How to use GNU Plot to plot diagrams in TeXShop" I get Warning. "Package pgf Warning: Plot data file `filename.sin.table' not found." –  user24058 Jan 7 '13 at 16:06
1  
In your TeXShop Preferences -> Engines -> pdfTeX (Latex) try adding --shell-escape to the command. So the whole command should read: pdflatex --file-line-error --synctex=1 --shell-escape. Restart TeXShop and try again. –  Alan Munn Jan 8 '13 at 0:10

2 Answers 2

Most of the the answer to this is contained in the following question:

However, depending on how your system is set up you may need to do some extra things.

First, compiling source code on a Mac requires you to install XCode from the App store (it's free). See the following link for a nice description:

Second, you also need to allow TeX to run external programs like GnuPlot. Typically the way to do this is to run programs with the --shell escape option. However, recent version of TeX Live have created a system of so-called "restricted" shell escape, which allows you to add programs to a global list of external programs to minimize the security issues of using unrestricted shell escape.

There are a number of different ways to implement this on a Mac.

Create a TeXShop engine file for --shell-escape

The simplest way is probably to create a new TeXShop engine file which runs the appropriate LaTeX command with the --shell-escape option enabled. See:

Create a config file in your texmf-local folder

If you are using gnuplot capabilities a lot, it might be easiest to add gnuplot to your list of allowable programs. This can be done by creating a local texmf.cnf file. Create the following file:

shell_escape_commands = \
bibtex,bibtex8,\
kpsewhich,\
makeindex,\
mpost,\
repstopdf,\
gnuplot,\

The file must end with a blank line. Save or copy this file into the following directory: (you will need administrator access to do this.)

/usr/local/texlive/texmf-local/web2c

Then run texhash to update the TeX database.

Now you should be able to use gnuplot from within your TeX documents.

share|improve this answer

The easiest way to install gnuplot on mac is to get the DMG file of Gnuplot, which is included in the DMG file of Maxima or Octave. Put the Gnuplot.app file in /Applications, and in your .bash_profile add a line

export PATH=$PATH:"/Applications/Gnuplot.app/Contents/Resources/bin"

After sourcing your new .bash_profile, you should be able to use gnuplot in terminal as well as in TikZ. Similar trick can be used to install Octave and Maxima painlessly. You should also configure your TeX engine with --shell-escape and --enable-write18.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.