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'm using LaTeX pdfTeX 3.1415926-1.40.9-2.2 on Mac OSX 10.6. When I try to build from TextMate (Ctrl+R) I get the following error:

Please add the directory containing “kpsewhich” to PATH in TextMate's Shell 
Variables preferences. 
share|improve this question
    
Just to be clear: you are using Textmate to run a shell? –  Charles Stewart Nov 9 '10 at 7:14
    
which OS and which LaTeX distribution? –  Juan A. Navarro Nov 9 '10 at 12:00
add comment

3 Answers

up vote 6 down vote accepted

open up the file ~/.bash_profile and add the following to the end

PATH="/usr/texbin:${PATH}"
export PATH

This should patch the issue.

NOTE: To open the ~/.bash_profile open terminal and type mate ~/.bash_profile or vim ~/.bash_profile

FYI:

  • mate is the command line or bash call to TextMate.
  • vim is the bash call to vim (an command line editor).
  • ~ is the bash reference to your home directory.
  • a . before a file is UNIX's (What OSX runs on) way of specifying a hidden file, which is why you can't see the .bash_profile in your home folder.
share|improve this answer
    
Hey Ban, How do you open up the file ~/.bash_profile? –  Helen Nov 13 '10 at 3:30
add comment

How about: go to 'Preferences' in TextMate, and add /usr/texbin to the PATH in the 'Shell Variables'? After all, that is what TextMate itself suggests ...

share|improve this answer
1  
Adding that path directly to your bash profile makes LaTeX, TeX, etc accessible not only from TextMate, but also from Terminal or any other program that accesses programs through the command line. –  Ben Nov 15 '10 at 22:27
add comment

Neither of these path-setting options worked directly for me. Not even after restarting Textmate 2.

However, I noticed that there was a little check box next to the PATH - the first line in Textmate - Preferences - Variables. Checking that box immediately resolved the problem. I had previously run

which kpsewhich

from the command prompt and added its path to both ~/.bashrc and the PATH text value. That editing that field didn't automatically check the box or ask if I wanted it checked is well just one of those things that might have been nice for the developers to have thought of as being useful.

share|improve this answer
add comment

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.