This may not be what you want, and it may seem crude, but it works well and I've been using it for a long time.
I use vim
, skim
, and make
. I keep vim
open in one window, skim
, in another, and have a shell window with a loop that runs make
. This needs to be visible because it's where the LaTeX errors will show up.
Skim is a free PDF reader that has a setting that will make it check to see if the original PDF file has changed. Not sure whether it runs in OSes other than OS X.
A Makefile is a script for make that tells make to do something to file X if files Y, X, etc. have changed.
I configure a Makefile to run xelatex
on a .tex file that I'm editing whenever it changes. This creates a new PDF. Then skim
loads the new version of the PDF.
Then I start a shell script that runs make
in a loop.
If you're using a DVI previewer, try to find one that will watch the dvi file for changes. Alternatively, some dvi previewers can be told to reload the file. In the old days, I had the Makefile run a command that sent a Unix signal to the dvi previewer, telling it to reload the file. There used to be a way to do something similar to Acrobat Reader, but it didn't work very well. That's why I switched to Skim (which is not perfect).
Here's a bare bones Makefile:
myfile.pdf: myfile.tex myfile.bbl
xelatex myfile.tex
You would put text something like that in a file named "Makefile", and put in the same directory as your .tex files.
For OS X/Unix/Linux, you can write a loop like this:
#!/bin/bash
while true; do sleep 2; make -s "$@"; done
You would put this in a text file and make it executable. Then run this script from the directory where the Makefile is. You can do something similar in Windows, but the shell language is different. If there's no make
installed in Windows, there are free Windows versions available. Linux will have it preinstalled.