TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using LaTeX on a Mac. The editor I use is Textmate 2.

When I hit "typeset & view", what I get is something like

! LaTeX Error: File 'xy.sty' not found.

However, if I do pdflatex abc.tex from the command line, everything works fine.

From the information provided by pdfLaTeX, I noticed that the only .sty files that can be found are in the folder /usr/local/texlive/2012/texmf-dist/tex/latex/base/, while the other packages are in places like /usr/local/texlive/2012/texmf-dist/tex/generic/.

That seems to cause the problem. I don't want to shuffle .sty files among folders. Can I make things work by changing some settings? Like can I let the compiler know to look for some .sty files in some other folders under /usr/local/texlive/2012/texmf-dist/?

share|improve this question
Did you install MacTeX from Safari? I have a friend who had problems when he used Chrome to download it on his Mac. – Nathanael Farley Feb 8 '13 at 10:28
I don't think it has anything to do with browser. It is more about settings. – h__ Feb 8 '13 at 16:20
Try compiling abc.tex first from the Terminal and then from TextMate; for both cases, add here the 20 lines of the log file. – egreg Feb 8 '13 at 18:53
@egreg I solved the problem. See my edit. – h__ Feb 8 '13 at 19:37
up vote 0 down vote accepted

I figured it out by myself. It's more about installing TeX Live on a Mac than about TextMate 2.

This problem is likely to be caused by installing Tex Live twice. Here is the solution:

  1. Clean out all previous Tex Live file. (sudo rm -rf /usr/local/texlive)

  2. On Mac OS X, an online installation is done by a command line tool (install-tl) with a text interface. Make sure it is a "sudo install" (on a Mac, the installer need root privilege but won't have it if not "sudo"ed.) Put type sudo and then drag the install-tl Unix executable in the terminal. Put in password if necessary.

  3. Be sure to set the options (O) before installing, tick the box of create symlinks in standard directories:(L) (This is why you need a sudo install.)

  4. After installation, tick the box of PATH in > Preference > Variables of TextMate. Make sure the directory of kpsewhich (which you can find by putting which kpsewhich in the terminal) is in the PATH variable.

share|improve this answer

Your Answer


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.