A decent setup for writing (OS X, with LaTeX)

I like using Ulysses for writing - it also has a decent LaTeX export plugin. The LaTeX processing tools were always a problem though: I could never get everything to work properly on OS X (and the i-Installer process is just hideous). Now I've managed to get a decent process working, compiled from source, thanks mostly to the new beta versions of TeTeX 3: here are the setup notes...

  1. curl 'ftp://dante.ctan.org/pub/tex/systems/unix/teTeX-beta/tetex-src.tar.gz'
    curl 'ftp://dante.ctan.org/pub/tex/systems/unix/teTeX-beta/tetex-texmf.tar.gz'

  2. tar -xvzf tetex-texmf.tar.gz
    sudo mkdir -p /usr/local/tetex/share/texmf
    sudo mv tetex-texmf/* /usr/local/tetex/share/texmf/

  3. tar -xvzf tetex-src.tar.gz
    cd tetex-src
    sudo make install

  4. cd /usr/local/tetex/bin
    sudo ln -s powerpc-apple-darwin7.6.0 powerpc-apple-darwin-current

  5. setenv TEXMFMAIN /usr/local/tetex/share/texmf
    sudo texconfig confall
    sudo texconfig font rw

  6. sudo mkdir /usr/local/tetex/share/texmf/tex/plain/misc/
    sudo curl 'http://www.polya.uklinux.net/protcode.tex' \
    -o '/usr/local/tetex/share/texmf/tex/plain/misc/protcode.tex'
    sudo curl 'http://www.polya.uklinux.net/abbr.tex' \
    -o '/usr/local/tetex/share/texmf/tex/plain/misc/abbr.tex'
    sudo texhash

Everything's installed under /usr/local/tetex, so you can just get rid of everything in that folder for a clean start.

Do the writing in Ulysses, export the LaTeX file, then use whatever editor you like to customise the markup. I'm using SubEthaEdit, and adding '\usepackage{lmodern}' to the LaTeX preamble to get decent looking Latin Modern fonts.

I'm also running latexmk and TeXniscope to automatically update a PDF preview whenever changes are made to the LaTeX file:

  1. sudo curl 'http://www.ctan.org/tex-archive/support/latexmk/latexmk.pl' \
    -o '/usr/local/bin/latexmk'
    sudo chmod 755 /usr/local/bin/latexmk

  2. Edit ~/.latexmrc:
    $pdf_previewer = 'open -a TeXniscope.app';
    $pdf_update_method = 0;
    $pscmd='ps -ww -u $ENV{USER}';

  3. latexmk -pvc -pdf -quiet FILE.tex (where FILE is the name of the file to monitor for changes)