I reopen this post, which was started some time ago but didn't came with a solution. I don't really remember what was the exact problem with this (well, of course, gnuplot didn't work correctly). So I write here my actual problem, which is the same as before.
Problem
I reinstalled the operating system (Mac OS X 10.8.2), installed MacTeX (the last one), installed MacPorts and gnuplot through it (in an administrator account). In this account, the command port works correctly from terminal (which let mi install gnuplot), and also does gnuplot app (from terminal). Then created a new (non-admin) account, and then neither port nor gnuplot worked. After little hacking (here it is more info), I solved it.
Now port and gnuplot work both from terminal in both accounts.
But here is the problem. I use TextMate to compile my documents, which compiles everything perfectly. But if I use some code which needs of gnuplot it isn't able to call it. See at the bottom for some examples.
On the contrary, if I call the file from the terminal with pdflatex --shell-escape file.tex then it compiles perfect.
Question
What happens? Is it a PATH problem? How can I solve it? (I don't really understand what is a PATH, therefore I can't try/imagine by myself)
Code and Logs
Example 1:
\documentclass{scrartcl}
\usepackage{gnuplottex}
\begin{document}
\begin{gnuplot}
plot sin(x)
\end{gnuplot}
\end{document}
Part of the .log file
\openout3 = `Ejercicio1-gnuplottex-fig1.gnuplot'.Opening gnuplot stream Ejercicio1-gnuplottex-fig1.gnuplot runsystem(gnuplot Ejercicio1-gnuplottex-fig1.gnuplot)...executed.
Package gnuplottex Warning: Conversion of Ejercicio1-gnuplottex-fig1.gnuplot fa iled.
Package gnuplottex Warning: Please convert Ejercicio1-gnuplottex-fig1.gnuplot m anually.
And from the terminal no error at all.
Example 2:
\documentclass{scrartcl}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot gnuplot {sin(x)};
\end{axis}
\end{tikzpicture}
\end{document}
The .log problems from TextMate:
Latex Error: ./Ejercicio1.tex:6 Package pgfplots Error: Sorry, the gnuplot-result file 'Ejercicio1.pgf-plot.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 .gnuplot' manually on the respective gnuplot file..
! Package pgfplots Warning: You have an axis with empty range. Replacing it with a default range and clearing all plots.
And no errors from terminal with pdflatex --shell-escape file.tex.
-shell-escapeoption to be turned off. Recheck this option under Preferences in your LaTeX bundle. See How and Why to use TextMate for LaTeX (starting from Setup). Since I don't have TextMate nor a Mac, I'm unable to test this myself. – Werner Dec 28 '12 at 17:48pdflatex? – Werner Dec 28 '12 at 23:05pdflatex --shell-escapeon the command line? – Percival Ulysses Dec 29 '12 at 00:42pdflatex --shell-escape YourDocument.tex(should, \write18 is there)? And you have no trouble compiling simple LaTeX documents from TM 2.0? – Percival Ulysses Dec 29 '12 at 00:56texconfig conf. – Percival Ulysses Dec 29 '12 at 12:16/opt/local/binnamedpdflatexwhich links to/opt/local/libexec/texlive/binaries/pdftex. So I have two TeX installed. How can I delete the MacPorts one? How could I get my PATH right? – Manuel Dec 29 '12 at 14:23/usr/texbin? What is the output ofwhich texconfig? – Percival Ulysses Dec 29 '12 at 15:10/usr/texbin/texconfig. – Manuel Dec 29 '12 at 15:26which pdflatex? – Percival Ulysses Dec 29 '12 at 17:00/usr/texbin/pdflatex– Manuel Dec 29 '12 at 17:01pgfplots.sty. In which texmf tree is it? – Percival Ulysses Dec 29 '12 at 17:03pgfplots.sty(at least the one I think pdflatex usually uses) is in/usr/local/texlive/2012/texmf-dist/tex/latex/pgfplots– Manuel Dec 29 '12 at 17:08/usr/texbin/pdflatex mydocument.tex, and what happens when you run/opt/local/bin/pdflatex mydocument.tex? – Percival Ulysses Dec 29 '12 at 17:51/usr/texbin/pdflatex mydocument.texworks. The/opt/…doesn't. But now if I writegnuplotin the terminal it doesn't work, I need to write/opt/bin/gnuplot. – Manuel Dec 29 '12 at 20:29/opt/local/bin(and/opt/local/sbin) in your PATH. See here for further explanation. – Percival Ulysses Dec 29 '12 at 20:47gnuplotworks. And if I call/usr/texbin/pdflatex --shell-escape doc.texit WORKS!! The only thing I need to do is make sure thatpdflatexin terminal call/usr/texbin/pdflatexand not/opt/local/bin/pdflatexwhich is wrong. – Manuel Dec 29 '12 at 20:59/usr/texbin/pdflatexis called,/usr/texbinmust be before/opt/local/binin your PATH. Seeecho $PATHon your shell if it does. It would be interesting to know why your macports installed TeXlive. I guess there exists a dependency. You can check this withportand some options (see on their page). Maybe you can remove it. To something different: What's the matter with TextMate? Does it work now? – Percival Ulysses Dec 29 '12 at 21:22/private/etc/pathsfile and wrote/usr/texbinin the first line (and now it works well from the command line). But, still doesn't work from TM 2.0 (I will add some info tomorrow). – Manuel Dec 30 '12 at 00:40