Macports Emacs and AUCTeX with TexLive

Macports Emacs and AUCTeX with TexLive

UPDATE: I think the current (as of 20/10/2014) AUCTeX through Macports works as intended and the below is not required.

How to get them to play nicely. If using the Macports emacs-app version of emacs there are couple of things to do to get AUCTeX to work properly with your TeXLive installation.

This assumes you are starting with no emacs and no AUCTeX, but with a working TexLive install.

  1. Install emacs-app using Macports
  2. Make a local port repository for MacPorts in your home dir following the instructions here.
  3. Add a local Portfile for Auctex by copying the existing one from your existing repository (following the guide to make the parent directories – in this case “local port repository”/editors/auctex)
  4. Edit the following line (41 in my file) to:

    configure.args-append --with-texmf-dir=/usr/local/texlive/texmf-local

    The original line points to a directory that doesn’t exist…

  5. Install Auctex using:

    sudo port install auctex +emacs_app +mactex

  6. Edit your .emacs file to include the following line:

    (setenv "PATH" (concat "/usr/texbin:" (getenv "PATH")))
    From here.

That should be it to get C-C C-C to invoke latex and xdvi.