Cameron Lane

Erstwhile educator. Python programmer.

Upgrade to Lion Breaks pdflatex

Normally, I write tests and quizzes in LaTeX. I edit the files in MacVim.  Periodically, I need to compile my .tex file and look at the resulting PDF.  This is repetitive and can involve a lot of typing, so in my vimrc, I remapped the key to run pdflatex on the current file. It looked like this:

 noremap <F5> :! pdflatex %<CR>

After making that change to my vimrc, pressing produces a pdf of the current file. Or at least it did until I upgraded to Lion. When I issued the command after the upgrade (either by pressing or issuing it in command mode), I received the following message:

 /bin/bash: pdflatex: command not found shell returned 127

Apparently, at some point in the Lion upgrade process, all of my TeX related files got moved from their default location on my executable path (I think they used to be in /usr/bin/texlive or something like that). As a result, my shell could not find the binary to execute. I ended up finding the files I needed located at the following path on my machine: /usr/texbin/

This is where all the goodies for TeX are now stored, and I don't think I remember seeing that directory prior to the upgrade.  At any rate, if you're having this problem, here is a fix for you.  Change your remapping in the vimrc file to the following:

 noremap <F5> :! /usr/texbin/pdflatex %<CR>

You could also issue the command from inside MacVim as

 :! /usr/texbin/pdflatex %

Problem solved!  I'm sure that I could have added this directory to my executable path and everything would have worked out fine.  However, I couldn't really remember all the ways to set your $PATH variable and didn't have time to look it up.  This worked as a quick solution.  Hope it helps someone.

comments powered by Disqus