Hey folks -
I'm trying to get up-and-running with TextMate, which I will be using primarily for LaTeX-ing, and I'm having some troubles. I've been using LaTeX installed via MacPorts/DarwinPorts for a few months now, so I'd prefer to get TM working with that if possible rather than abandoning it for MacTex (unless there is really and truly a good reason to do so).
The main problem I'm having is that when I call the "Insert Label/ Citation Based on Current Word" command, TM spits out "The tex binaries cannot be located!" I assume this means that I have not properly told TM where to find my LaTeX installation, but I can't figure out how to do so. I tried creating a PATH environment variable equal to the output of "echo $PATH" in Terminal, but I don't think it helped. Sorry... either I'm doing something dumb or I'm just not unix-y enough to understand what's going on here.
Any suggestions?
Thanks very much!
Best - Chris MacMinn
On Mar 16, 2007, at 4:57 PM, Christopher W. MacMinn wrote:
Hey folks -
I'm trying to get up-and-running with TextMate, which I will be using primarily for LaTeX-ing, and I'm having some troubles. I've been using LaTeX installed via MacPorts/DarwinPorts for a few months now, so I'd prefer to get TM working with that if possible rather than abandoning it for MacTex (unless there is really and truly a good reason to do so).
The main problem I'm having is that when I call the "Insert Label/ Citation Based on Current Word" command, TM spits out "The tex binaries cannot be located!" I assume this means that I have not properly told TM where to find my LaTeX installation, but I can't figure out how to do so. I tried creating a PATH environment variable equal to the output of "echo $PATH" in Terminal, but I don't think it helped. Sorry... either I'm doing something dumb or I'm just not unix-y enough to understand what's going on here.
Here are the steps that TextMate takes to locate the LaTeX binaries:
First, it tries: which kpsewhich
If that doesn't work, it tries the two explicit locations: /usr/texbin/kpsewhich /usr/local/teTeX/bin/powerpc-apple-darwin-current/kpsewhich
And if those files aren't found either, it finally sources the /etc/ profile file, and tries again: . /etc/profile; which kpsewhich
So let's try and diagnose where your problems are. What do you get if you run the "Execute Selection As Ruby" command with the following two lines selected?
puts `which kpsewhich` puts `. /etc/profile; which kpsewhich`
Then, what do you get if you run the following line in the terminal: which kpsewhich
Finally, what is the value of the variable $PATH when you do "echo $PATH" in the terminal?
Any suggestions?
Thanks very much!
Best
- Chris MacMinn
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Answers to your questions are below -- thanks for you help, I really appreciate it!
Best - Chris
So let's try and diagnose where your problems are. What do you get if you run the "Execute Selection As Ruby" command with the following two lines selected?
puts `which kpsewhich` puts `. /etc/profile; which kpsewhich`
RubyMate r6354 running Ruby r1.8.2 (/usr/bin/ruby)
untitled
/opt/local/bin/kpsewhich no kpsewhich in /bin /sbin /usr/bin /usr/sbin
Then, what do you get if you run the following line in the terminal: which kpsewhich
/opt/local/bin/kpsewhich
Finally, what is the value of the variable $PATH when you do "echo $PATH" in the terminal?
/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
On Mar 16, 2007, at 6:41 PM, Christopher W. MacMinn wrote:
puts `which kpsewhich` puts `. /etc/profile; which kpsewhich`
RubyMate r6354 running Ruby r1.8.2 (/usr/bin/ruby)
untitled
/opt/local/bin/kpsewhich no kpsewhich in /bin /sbin /usr/bin /usr/sbin
Hm, this is perplexing me a bit. You mean that "puts `which kpsewhich`" finds the kpsewhich binary, but "puts `. /etc/profile; which kpsewhich" doesn't? Also please run it not using RubyMate, but using the "Execute Selection as Ruby" command, which is typically bound to ctrl-shift-E, just to make sure that we are talking about the exact same thing.
Can you also send me the contents of /etc/profile? And also .bash_profile or any other initialization file that may be in use. I guess the key question is: How does DarwinPorts add to the PATH variable? If it was doing it by messing with /etc/profile, then the above should have worked. Does it use .bash_profile or something like that?
One simple solution that I can think of is that you create a symbolic link named /usr/texbin to point to /opt/local/bin, though I'm not sure if this could cause any other problems.
I suppose we could also add /opt/local/bin to the list of directories we are explicitly looking for.
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Hm, this is perplexing me a bit. You mean that "puts `which kpsewhich`" finds the kpsewhich binary, but "puts `. /etc/profile; which kpsewhich" doesn't? Also please run it not using RubyMate, but using the "Execute Selection as Ruby" command
Interestingly, I do get different results when I "Execute Selection as Ruby" rather than just "Run":
no kpsewhich in /usr/bin /bin /usr/sbin /sbin no kpsewhich in /bin /sbin /usr/bin /usr/sbin
Can you also send me the contents of /etc/profile?
# System-wide .profile for sh(1)
PATH="/bin:/sbin:/usr/bin:/usr/sbin" export PATH
if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi
And also .bash_profile
No .bash_profile
or any other initialization file that may be in use.
I have been using ~/.bashrc, which looks like this:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Is .bash_profile preferred for some reason?
I guess the key question is: How does DarwinPorts add to the PATH variable?
I think the ~/.bashrc above answers that question.
One simple solution that I can think of is that you create a symbolic link named /usr/texbin to point to /opt/local/bin, though I'm not sure if this could cause any other problems.
I suppose we could also add /opt/local/bin to the list of directories we are explicitly looking for.
It sounds like TextMate needs to be looking in /opt/local/bin and/or / opt/local/sbin, but it isn't.
Best - Chris
On Mar 18, 2007, at 1:33 PM, Christopher W. MacMinn wrote:
# System-wide .profile for sh(1)
PATH="/bin:/sbin:/usr/bin:/usr/sbin" export PATH
if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi
I have been using ~/.bashrc, which looks like this:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Ok, this is the problem then I guess. It seems that sourcing ./etc/ profile does not also source ~/.bashrc nor ~/.bash_profile, so these settings are never seen. So I don't really know what the best solution would be here. I'm already not very happy about sourcing / etc/profile, and I would be even less happy about sourcing even more files. For now I added /opt/local/bin to the list of explicit paths we use for locating kpsewhich. So if you svn up now, it should work just fine for you (I hope).
Best
- Chris
Haris Skiadas Department of Mathematics and Computer Science Hanover College
Success -- it works beautifully. Thanks so much!
Best - Chris
On Mar 18, 2007, at 1:43 PM, Charilaos Skiadas wrote:
On Mar 18, 2007, at 1:33 PM, Christopher W. MacMinn wrote:
# System-wide .profile for sh(1)
PATH="/bin:/sbin:/usr/bin:/usr/sbin" export PATH
if [ "${BASH-no}" != "no" ]; then [ -r /etc/bashrc ] && . /etc/bashrc fi
I have been using ~/.bashrc, which looks like this:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Ok, this is the problem then I guess. It seems that sourcing ./etc/ profile does not also source ~/.bashrc nor ~/.bash_profile, so these settings are never seen. So I don't really know what the best solution would be here. I'm already not very happy about sourcing / etc/profile, and I would be even less happy about sourcing even more files. For now I added /opt/local/bin to the list of explicit paths we use for locating kpsewhich. So if you svn up now, it should work just fine for you (I hope).
Best
- Chris
Haris Skiadas Department of Mathematics and Computer Science Hanover College
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate