Take the 2-minute tour ×

Possible Duplicate:
"kpsewhich" error when trying to build from Textmate

Most manuals I have seen on textmate claims that command+B is compiling LaTeX documents, however this command seems to just add \textbf{}. Some other manual claims that command+R is the way to compile, however this command yield the following result:

Can't find “kpsewhich” on PATH.

What does this mean, and what is the solution?

I have downloaded textmate and mactex. I'm not sure if I need the mactex.zip. I'm new to both text mate and Mac. (Have used LaTeX on Ubuntu for 2 years, however)

share|improve this question

marked as duplicate by frabjous, Caramdir, Alan Munn, Seamus, lockstep Aug 12 '11 at 20:30


Have you actually installed MacTeX as well as TextMate? If not, your problem isn't with the path, it's the fact that you haven't actually installed MacTeX. –  Alan Munn Aug 12 '11 at 2:53

1 Answer 1

Your PATH environmental variable is a list of directories that your computer searches through in order to find programs to execute. You can find it by opening a terminal and typing:

echo $PATH

Most likely when you installed MacTeX, it did not change your PATH, and so your computer does not know what folders to look in in order to find your MacTeX executable programs ("binaries"). (kpsewhich is one such program).

There are different ways to change your PATH; googling it would turn up a lot. My personal preference would be to edit (or create) the file ~/.profile (or use ~/.bash_profile if it already exists), and add a line that looks like this:

export PATH=/usr/texbin:$PATH

That (after a new log in) should add /usr/texbin to the beginning of your PATH. Note, I am not a MacTeX user, and so I'm not sure that's the right directory to add. I'm getting that from this page in the MacTeX FAQ. You'll want to make sure that directory contains kpsewhich and the other MacTeX programs. (For me, on texlive for Linux, they're in /usr/local/texlive/2011/bin/x86_64-linux.)

share|improve this answer
Oops, posted this before i noticed this way a duplicate thread. –  frabjous Aug 12 '11 at 0:32
I'm surprised to hear all these answers about changing paths. The GUI installer for textmate is supposed to work without any problems. Now, I've went to Textmate>preferences>advanced>shell variable and here i found the following PATH /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/texbin so it should be working since /usr/texbin is in there? –  Daniel Aug 12 '11 at 9:00
PROBLEM IS SOLVED. Reboot(/log out+log in) somehow solved the problem. Sorry for taking up your time. –  Daniel Aug 12 '11 at 9:09
