5

I've been using the vim-latex suite on my mac (10.7.?) for months with no problem. Over the weekend, I upgraded the OS to 10.8.2, and now my tex files fail to compile. The compile command

\ll

produces no errors within vim, but no pdf-file gets produced. If I drop to the command line in a terminal, the following command

latex document.tex

produces

-bash: latex: command not found

Similarly, for pdflatex. I'm not sure if this is a path error, or if latex for 10.8.2 needs to be reinstalled. I'm not sure how to proceed in either case.

joelwatsonfish
  • 103
  • 1
  • 1
  • 5

4 Answers4

7

I had the same problem and typing:

export PATH=/usr/texbin:$PATH

seems to work fine in a shell. Although it no longer works if I open a new shell, this is a faster solution to re-downloading and re-installing the huge MacTeX program.

Yoga
  • 1,186
  • 1
  • 13
  • 24
  • 1
    You might want to put this into your .bashrc and/or .bash_profile. That way, the correct path will be set when you open a new shell. – digory doo Aug 01 '13 at 14:27
5

This happened to me after upgrading to OS X El Capitan. I found the latex executables in /usr/local/texlive/2014/bin/x86_64-darwin. So, I just added this to my .bashrc

export PATH="$PATH:/usr/local/texlive/2014/bin/x86_64-darwin"

No need to reinstall.

petew
  • 671
  • 8
  • 13
2

On OS X, the standard way for third party installers to add a directory to the path is to put a file under /etc/paths.d. TeXLive does this as part of the installation, but the OS upgrade probably blew it away.

You should be able to just create a new file under that directory containing just one line, the path the directory containing the TeX executables.

deong
  • 3,820
  • 21
  • 18
  • 1
    Thank you very much for the help; I'll remember it for future upgrades. Prior to reading your post, I opened a terminal and looked in the /usr/texbin directory, and saw latex, pdflatex, etc, but when I tried to execute them, I still received the "latex: command not found" error. I thought this odd, so I down-loaded and reinstalled MacTex, and now everything seems to be working again. Thanks for your help though. – joelwatsonfish Dec 17 '12 at 17:15
  • Yeah, reinstalling TeX will recreate the files as well. – deong Dec 17 '12 at 23:53
-1

When setting the path via @petew's answer, /usr/local/texlive/2014/bin/x86_64-darwin may not be the correct version. On my system /usr/local/texlive/2021/bin/universal-darwin was what was needed. Make sure to check your texlive binaries to see what file you downloaded.

Caidan
  • 21
  • 5