I have asked about this in the obvious places (pgf help forum and comp.text.tex) and after some initial help, the help has dried up. As this is going to be a specifically Mac users here, maybe the problem may be more obvious.
When I try and compile this code (from the manual):
\documentclass[a4paper]{article} \usepackage{pgfplots} \begin{document}
\begin{tikzpicture}% \begin{axis}[ xlabel=$x$, ylabel=$\sin(x)$, name=an axis, ] \addplot plot [id=sin] function{sin(x)}; \end{axis} \end{tikzpicture}%
\end{document}
I get these errors:
Latex Error: ./PDFPlotTrial2.tex:11 Package pgfplots Error: Sorry, the gnuplot-result file 'PDFPlotTrial2.sin.table' could not be found. Maybe you need to enable the shell-escape feature? For pdflatex, this is '>> pdflatex -shell-escape'. You can also invoke '>> gnuplot PDFPlotTrial2.sin.table' manually..
! Package pgfplots Warning: You have a plot with empty range. Replacing it with default and clearing plots.
Latex Error: ./PDFPlotTrial2.tex:13 Extra }, or forgotten \endgroup.
Latex Error: ./PDFPlotTrial2.tex:13 Missing } inserted.
Latex Error: ./PDFPlotTrial2.tex:13 Extra }, or forgotten \endgroup.
Latex Error: ./PDFPlotTrial2.tex:13 Missing } inserted.
Latex Error: ./PDFPlotTrial2.tex:15 LaTeX Error: \begin{tikzpicture} on input line 5 ended by \end{document}.
I have run pdflatex --shell-escape PDFPlotTrial2.tex from terminal (which seemed to work as I got pages of text appearing with no obvious error messages) and I have upgraded to version 2 of pgf. GNUPlot was installed with fink and runs OK from typing gnuplot in terminal.
I am now stuck, and no idea what to try next. I am pretty new to this so it could well be something so obvious that no one is suggesting it. Can anyone help.
Many thanks,
Graham
Le 2 sept. 08 à 09:31, Graham Smith a écrit :
I have run pdflatex --shell-escape PDFPlotTrial2.tex from terminal (which seemed to work as I got pages of text appearing with no obvious error messages) and I have upgraded to version 2 of pgf. GNUPlot was installed with fink and runs OK from typing gnuplot in terminal.
I am now stuck, and no idea what to try next. I am pretty new to this so it could well be something so obvious that no one is suggesting it. Can anyone help.
Hi
I don't have "pgfplots" on my computer and the first thing it's to to make a try with a simple example with only TikZ. For example
8<------8<------8<------8<------8<------8<------8<------8<------8<------ \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[color=blue] plot[id=sin,domain=0:6,samples=100] function{sin(x)}; \end{tikzpicture} \end{document} 8<------8<------8<------8<------8<------8<------8<------8<------8<------
If there is a problem with gnuplot, I think that the problem is a "PATH" problem.
I don't like the "fink" solution, I prefer to compile gnuplot from the sources. You can make a symbolic link in /usr/local/bin/ through gnuplot in the /sw directory (i don't know the exact folder) with "ln -s etc ..." If my answer is not correct and if you want more explanations, the better place is the mac OS TEX list (macosx-tex) if you work with TexShop or Itexmac. You have also the TexMate List if you work with TexMate.
Best Regards
Alain
Alain,
Thanks, I have tried this, and it compiles without errors, but gives a blank pdf.
Looking at the log file I see a warning:
Package pgf Warning: Plot data file `pgfplot5.sin.table' not found. on input li ne 6.
I shall have a go at sorting the links out, but I'm a bit out of my depth with this, and,
as you suggested, I have asked on the TextMate forum as it looks like a Mac/path issue.
Thanks again,
Graham
2008/9/2 Alain Matthes alain.matthes@mac.com:
Le 2 sept. 08 à 09:31, Graham Smith a écrit :
I have run pdflatex --shell-escape PDFPlotTrial2.tex from terminal (which seemed to work as I got pages of text appearing with no obvious error messages) and I have upgraded to version 2 of pgf. GNUPlot was installed with fink and runs OK from typing gnuplot in terminal.
I am now stuck, and no idea what to try next. I am pretty new to this so it could well be something so obvious that no one is suggesting it. Can anyone help.
Hi
I don't have "pgfplots" on my computer and the first thing it's to to make a try with a simple example with only TikZ. For example
8<------8<------8<------8<------8<------8<------8<------8<------8<------ \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[color=blue] plot[id=sin,domain=0:6,samples=100] function{sin(x)}; \end{tikzpicture} \end{document} 8<------8<------8<------8<------8<------8<------8<------8<------8<------
If there is a problem with gnuplot, I think that the problem is a "PATH" problem.
I don't like the "fink" solution, I prefer to compile gnuplot from the sources. You can make a symbolic link in /usr/local/bin/ through gnuplot in the /sw directory (i don't know the exact folder) with "ln -s etc ..." If my answer is not correct and if you want more explanations, the better place is the mac OS TEX list (macosx-tex) if you work with TexShop or Itexmac. You have also the TexMate List if you work with TexMate.
Best Regards
Alain
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Hello Graham, On Sep 2, 2008, at 3:31 AM, Graham Smith wrote:
I have run pdflatex --shell-escape PDFPlotTrial2.tex from terminal (which seemed to work as I got pages of text appearing with no obvious error messages) and I have upgraded to version 2 of pgf. GNUPlot was installed with fink and runs OK from typing gnuplot in terminal.
I am now stuck, and no idea what to try next. I am pretty new to this so it could well be something so obvious that no one is suggesting it. Can anyone help.
Many thanks,
This is almost certainly a path issue. First off, open the file again in TextMate, and press "opt-cmd-," which opens up the LaTeX preferences. Then click on the "Verbose TeX output" option, and type "-shell-escape" without the quotes in the Options box. Then close the window and compile again. This should show you the entire log file, and right before the first error you should be seeing the line: sh: line 1: gnuplot: command not found
If this is indeed the case, then the problem is simple. Fink changes the shell files that run when you start a new terminal, in order to place its directory there. You can see that by typing "echo $PATH" on a terminal window. TextMate does not get to use these path settings, because it inherits its shell from the login process. The consequence of that is that when pdflatex is executed from within Textmate, it really doesn't know about Fink and where to find it. There are numerous solutions to this problem:
First off, close TextMate completely, then go to the terminal, and type "open -a TextMate". This should start TextMate for you, but now TextMate is inheriting the path from the terminal, and this should recognize Fink. If you now open your file in TextMate and compile, it should work. Of course, this requires starting TextMate this way every time.
There are other solutions, each with its slight drawbacks, but let's first make sure the above solution correctly identifies the problem, and then we can take it from there. In brief, some of those solutions would be:
a) add a PATH variable in the TextMate general preferences, which echoes the path from the terminal. Pretty safe if you don't change that path often. b) Create a symbolic link to gnuplot from a location that is searched anyway, like for instance /usr/local/bin. You can get the full path to gnuplot by typing "which gnuplot" on the terminal. Should work if gnuplot doesn't have any dependencies on other parts of fink. c) As Alain suggested, compile gnuplot from scratch. This would place it in a location that is searched for anyway.
Graham
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Charilaos
This is almost certainly a path issue. First off, open the file again in TextMate, and press "opt-cmd-," which opens up the LaTeX preferences. Then click on the "Verbose TeX output" option, and type "-shell-escape" without the quotes in the Options box.
In fact this was all that was needed, it now works perfectly :-)
Many thanks for this, aren't problems simple to solve when you know the answer, and indeed, how to ask the question properly.
Graham
On Sep 2, 2008, at 5:48 AM, Graham Smith wrote:
Charilaos
This is almost certainly a path issue. First off, open the file again in TextMate, and press "opt-cmd-," which opens up the LaTeX preferences. Then click on the "Verbose TeX output" option, and type "-shell-escape" without the quotes in the Options box.
In fact this was all that was needed, it now works perfectly :-)
Glad to hear it!
It might be worth for us to consider enabling the flag by default when certain packages are included. For instance, we could search for pgfplots inclusion in the document, and automatically enable -shell- escape in that case. Right now, you would have that enabled for all your files unless you change it back each time, and presumably having it enabled has security consequences. Any thoughts from other more experiences LaTeX users? Are there other packages that need -shell- escape? Brad, what's your view?
And now, off to the second day of classes for me.
Many thanks for this, aren't problems simple to solve when you know the answer, and indeed, how to ask the question properly.
Graham
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Charilaos,
I assumed this was a Textmate issue, but as mentioned ealier it seems to be a fink issue as Emacs (aquamacs in fact) can't find Gnuplot either.
Not used symbolic links before, but I think I need to type this in the terminal
ln -s /usr/local/bin/gnuplot /sw/bin/gnuplot
Obviously gnuplot is at /sw/bin/gnuplot (from which gnuplot)
Does this look right to you.
Having said that, as Textmate is working with the escape code added, this probably suggests it isn't a path issue.
I'm a bit confused here.
Thanks again,
Graham
2008/9/2 Charilaos Skiadas .cskiadas@gmail.com:
On Sep 2, 2008, at 5:48 AM, Graham Smith wrote:
Charilaos
This is almost certainly a path issue. First off, open the file again in TextMate, and press "opt-cmd-," which opens up the LaTeX preferences. Then click on the "Verbose TeX output" option, and type "-shell-escape" without the quotes in the Options box.
In fact this was all that was needed, it now works perfectly :-)
Glad to hear it!
It might be worth for us to consider enabling the flag by default when certain packages are included. For instance, we could search for pgfplots inclusion in the document, and automatically enable -shell- escape in that case. Right now, you would have that enabled for all your files unless you change it back each time, and presumably having it enabled has security consequences. Any thoughts from other more experiences LaTeX users? Are there other packages that need -shell- escape? Brad, what's your view?
And now, off to the second day of classes for me.
Many thanks for this, aren't problems simple to solve when you know the answer, and indeed, how to ask the question properly.
Graham
Haris Skiadas Department of Mathematics and Computer Science Hanover College
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Le 2 sept. 08 à 13:45, Graham Smith a écrit :
Charilaos,
I assumed this was a Textmate issue, but as mentioned ealier it seems to be a fink issue as Emacs (aquamacs in fact) can't find Gnuplot either.
Not used symbolic links before, but I think I need to type this in the terminal
ln -s /usr/local/bin/gnuplot /sw/bin/gnuplot
Obviously gnuplot is at /sw/bin/gnuplot (from which gnuplot)
Does this look right to you.
I'm not a great Unix expert but this is correct for me but another answer from a real expert is necessary :)
Alain
On Tue, Sep 2, 2008 at 7:07 AM, Alain Matthes alain.matthes@mac.com wrote:
Le 2 sept. 08 à 13:45, Graham Smith a écrit :
Charilaos,
I assumed this was a Textmate issue, but as mentioned ealier it seems to be a fink issue as Emacs (aquamacs in fact) can't find Gnuplot either.
Not used symbolic links before, but I think I need to type this in the terminal
ln -s /usr/local/bin/gnuplot /sw/bin/gnuplot
Obviously gnuplot is at /sw/bin/gnuplot (from which gnuplot)
Does this look right to you.
No, that is backward. When using ln, mv, and cp always think you are copying from to So you want to link from /sw/bin/gnuplot to /usr/local/bin/gnuplot.
The real issue seems to be that without using the --shell-escape option /sw/bin/gnuplot is not in your PATH environment variable.
Brad
I'm not a great Unix expert but this is correct for me but another answer from a real expert is necessary :)
Alain
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Brad,
ln -s /usr/local/bin/gnuplot /sw/bin/gnuplot
Obviously gnuplot is at /sw/bin/gnuplot (from which gnuplot)
Does this look right to you.
No, that is backward. When using ln, mv, and cp always think you are copying from to So you want to link from /sw/bin/gnuplot to /usr/local/bin/gnuplot. The real issue seems to be that without using the --shell-escape option /sw/bin/gnuplot is not in your PATH environment variable.
Ah, thanks but isn't this an alternative to it being in the path?
Not that this seems to be an issue as TextMate is finding Gnuplot using the shell-escape command.
Graham
On Tue, Sep 2, 2008 at 5:04 AM, Charilaos Skiadas cskiadas@gmail.comwrote:
On Sep 2, 2008, at 5:48 AM, Graham Smith wrote:
Charilaos
This is almost certainly a path issue. First off, open the file again in TextMate, and press "opt-cmd-," which opens up the LaTeX preferences. Then click on the "Verbose TeX output" option, and type "-shell-escape" without the quotes in the Options box.
In fact this was all that was needed, it now works perfectly :-)
Glad to hear it!
It might be worth for us to consider enabling the flag by default when certain packages are included. For instance, we could search for pgfplots inclusion in the document, and automatically enable -shell- escape in that case. Right now, you would have that enabled for all your files unless you change it back each time, and presumably having it enabled has security consequences. Any thoughts from other more experiences LaTeX users? Are there other packages that need -shell- escape? Brad, what's your view?
I don't know how people feel about the security issue, but the online docs I've found are pretty clear about not enabling --shell-escape for documents you haven't written yourself. I rarely download tex source and typeset it so this is not a big deal for me. Although texMate could auto-enable the shell-escape option by detecting certain packages it would have no way of knowing whether the user had written the document or not. Perhaps a middle ground would be to put up a warning if one of the packages is included and the user has not enabled shell-escape.
Rather than setting the global option to enable shell-escape users can also insert the following line at the top of their document: %!TEX TS-options = --shell-escape
This can be done manually or by using the File Preferences menu in the latex bundle.
Brad
And now, off to the second day of classes for me.
Many thanks for this, aren't problems simple to solve when you know the answer, and indeed, how to ask the question properly.
Graham
Haris Skiadas Department of Mathematics and Computer Science Hanover College
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Not so paranoid about security, but for what it is worth here is a vote against enabling --shell escape by default.
The TeX directive is a good idea I think, but there is a potential wrinkle. XeTeX doesn't take --shell-escape but -shell-escape, that is, one dash preceding, not two. So running XeTeX with a document with the proposed TeX directive is going to throw up errors...
On 9/2/2008, "Brad Miller" millbr02@luther.edu wrote:
I don't know how people feel about the security issue, but the online docs I've found are pretty clear about not enabling --shell-escape for documents you haven't written yourself. I rarely download tex source and typeset it so this is not a big deal for me. Although texMate could auto-enable the shell-escape option by detecting certain packages it would have no way of knowing whether the user had written the document or not. Perhaps a middle ground would be to put up a warning if one of the packages is included and the user has not enabled shell-escape.
Rather than setting the global option to enable shell-escape users can also insert the following line at the top of their document: %!TEX TS-options = --shell-escape
This can be done manually or by using the File Preferences menu in the latex bundle.
Actually, LaTeX seems quite happy with the one dash as well.
I like the idea of a warning, in combination with the directive. Namely, if the directive is there follow it, as I think we do now. If it is not there but a package that needs it is loaded, then put up a warning, suggesting that the user add such a directive to the document.
Graham, this directive should work in TeXShop as well, that's where we got those directives from (In fact, TS is for TeXShop). If I remember correctly though, TeXShop is very picky about spaces or not around the equal sign, I can't remember what it expects but it is picky about it. But it is certainly an "editor" thing, not a "latex" thing, so it's up to each editor to support it or not, TeXShop started it I think. So that would be something to take up with the emacs folks.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
On Sep 2, 2008, at 8:39 AM, Mark Eli Kalderon wrote:
Not so paranoid about security, but for what it is worth here is a vote against enabling --shell escape by default.
The TeX directive is a good idea I think, but there is a potential wrinkle. XeTeX doesn't take --shell-escape but -shell-escape, that is, one dash preceding, not two. So running XeTeX with a document with the proposed TeX directive is going to throw up errors...
On 9/2/2008, "Brad Miller" millbr02@luther.edu wrote:
I don't know how people feel about the security issue, but the online docs I've found are pretty clear about not enabling --shell- escape for documents you haven't written yourself. I rarely download tex source and typeset it so this is not a big deal for me. Although texMate could auto-enable the shell-escape option by detecting certain packages it would have no way of knowing whether the user had written the document or not. Perhaps a middle ground would be to put up a warning if one of the packages is included and the user has not enabled shell-escape.
Rather than setting the global option to enable shell-escape users can also insert the following line at the top of their document: %! TEX TS-options = --shell-escape
This can be done manually or by using the File Preferences menu in the latex bundle.
Graham, this directive should work in TeXShop as well, that's where we got those directives from (In fact, TS is for TeXShop). If I remember correctly though, TeXShop is very picky about spaces or not around the equal sign, I can't remember what it expects but it is picky about it. But it is certainly an "editor" thing, not a "latex" thing, so it's up to each editor to support it or not, TeXShop started it I think. So that would be something to take up with the
Ah, OK I am learning a lot here so I need to check this out on an editor by editor basis.
Thanks again.
Graham
picky about it. But it is certainly an "editor" thing, not a "latex" thing,
Not really relevant to this group, but now that I know its an editor issue a quick google gave me the solution to emacs/auctex problem
%%% Local variables: %%% mode: LaTeX %%% LaTeX-command: "latex -shell-escape" %%% TeX-master: t %%% End:
Inserted at the beginning of the file makes it all work.
Many thanks again.
Graham