[Tex/LaTex] “kpsewhich” error when trying to build from Textmate

editorserrorstextmate

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. 

Best Answer

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 1: To open the ~/.bash_profile open terminal and type mate ~/.bash_profile or vim ~/.bash_profile

NOTE 2: The PATH could be located elsewhere for you as mentioned in one of the comments bellow

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.
Related Question