I want to throw my hat in the ring with those who have already endorsed Homebrew for the Mac. Homebrew is a fantastic way to install lots of the programs that you’ll very likely want to use as you get more and more into LaTeX.
For example, the other day I watched this great screencast on paragraph formatting in Vim, and I was convinced that I really wanted to try out the program discussed there, Par. There are two options for getting Par. One is to go over to the main web site, choose one of the seven download packages to download, and then install it. Here are the installation instructions:
On most UNIX–like systems, “make –f protoMakefile” will work, but you might want to read the comments in protoMakefile, or use the autoconf add-on for Par 1.52 contributed by Nelson H. F. Beebe, or take a look at some hints for building par on various platforms.
I’m actually fairly comfortable following these instructions, but there was a point in time where I wasn’t. There was a point in time (not so long ago, really), where I wouldn’t have known what this meant at all. Even now, if there were a more straightforward way to do this, I’d take it.
There is! Homebrew makes installing packages like Par a breeze. Instead of doing the above, all you need to do is open up Terminal.app and type brew install par, then hit Enter. If you’ve installed Homebrew, it will download the application and install it for you. And if you happen to need another program to make the one you want run, Homebrew will install that, too (e.g., I needed Tokyo-Cabinet to make the mail program mutt run; Homebrew knew this and installed it for me).
Homebrew is the (new) package manager for the Mac. It makes installing certain sorts of programs very easy (mostly these are command-line programs; all of them are free to download). And it makes updating these programs easy, too. How would you go about updating Par, given the above instructions? I am not entirely sure. But if you installed it via Homebrew, you would type brew update and update all the programs that you’ve installed via Homebrew (I haven’t done this yet, but the documentation suggests that this is how this works).
Installing Homebrew is actually quite easy. The main github page for Homebrew explains the installation instructions clearly. Literally, this is all you need to do:
- Copy and paste the following into Terminal.app:
ruby -e "$(curl -fsS http://gist.github.com/raw/323731/install_homebrew.rb)"
- Install Apple’s Xcode either directly from Apple or via your OS X installation disk (you’ll have to register as a developer to do this, but it is free, so there is no reason not to). I think installing the developer tools via Xcode installs some of the higher-powered command-line tools you need to run things like git; whatever the reason, you need to install it.
Once you’ve installed Homebrew, you can search for a program by typing brew search /search_term/, with the slashes included. Then just type brew install program_name to install a program, brew uninstall program_name to uninstall a program, and brew help for help.
MacVim
You can even use Homebrew to install MacVim, if you like. Just brew install macvim and you are good to go. In the terminal, type mvim and hit Enter. MacVim will open and the icon will appear in your Dock. Right click on it (or Command+Click) and then under ‘Options’ you can choose ‘Leave in Dock’ to make it stick around after you close it. In the future I’ll talk about git in detail, I hope. You can install git with a brew install git (no real surprise there, huh?).
I highly recommend Homebrew. And if, for some reason, you need to uninstall Homebrew, just follow the directions toward the bottom of this page. (I know this because something messed up with my installation the other day. I simply did a brew list to see all the programs I had installed, followed these directions to easily uninstall Homebrew, then reinstalled using the directions above (though I obviously didn’t have to install Xcode again), and used the list I just generated to quickly reinstall the programs I needed. Very quick and very easy.)

You need to install Xcode because otherwise you won’t have a compiler (usually GCC) available to build and install Homebrew’s packages.
Since Mac options are on the table, I’ll add that I’ve been using TeXshop for years and have been very happy with it. Admittedly, it doesn’t allow for intricate grepping of the file; for that, I load the source in something else.
Hi Benedict, That makes sense. Thanks for filling me in on the details!
Hi P.D., I agree that TeXShop is a very nice editor. It is everything that a Mac LaTeX editor should be–it is clean and intuitive and ‘just works’. I think some of the features (like its use of SyncTeX) are particularly nice. I also think it has more options and features than I realized when I switched over to another editor. Do you have any favorite TeXShop features?
Does Homebrew really install packages by compiling source rather than just installing binaries? If so, I wonder why. Of course, nearly all Linux distributions come with a package manager like this and they’re great (apt-get for Debian/Ubuntu, yum for Fedora, pacman for Arch, etc.). They usually just install binaries, though, unless it’s something unusual or you specifically request to install from source (e.g., if you want to change something). Only Gentoo’s portage system always installs from source. I guess compiling from source, although slower and less failsafe, can result in binaries more optimized to your hardware, but since hardware for macs all comes from Apple, I wouldn’t have thought that was much of an issue. The biggest problem with compiling from source is that for complicated stuff it can take forever, which is pretty annoying if you’re not actually changing anything about it.
P.D., what sort of things do you have in mind by “intricate grepping of the file”? I’ve never used TeXshop, but from what I’ve heard, it’s a lot like TeXworks. TeXworks supports regular expression find/replaces, so I would have guessed that TeXshop does too. But maybe you meant something more elaborate. I’m curious about what, if anything, TeXshop offers that TeXworks doesn’t, but I guess that’s for another post.
Hey Kevin,
I just looked at the Homebrew wiki FAQ. In response to “Why are you compiling everything?” they say:
So there you have it. Free hosting on github is a nice thing for projects like this, but I guess it has its costs.
Thanks for collection all i need in one place
I came across this page looking for instructions on how to uninstall Homebrew: my old setup was a little borked even before the Migration Assistant didn’t quite get the group permissions right.
Anyway, you can find the steps I took at this old revision of the Installation wiki page; I’m not sure when or why they removed it:
https://github.com/mxcl/homebrew/wiki/Installation/1bf508367dcc186ae0f41ce5d64d4775014272d8