LatexMk is a Perl script for running LaTeX the correct number of times to resolve cross references, etc; it also runs auxiliary programs (bibtex, makeindex if necessary, and dvips and/or a previewer as requested). Essentially, it is a highly specialized relative of the general make utility. It has a number of other useful capabilities, for example to start a previewer and then run latex whenever the source files are updated, so that the previewer gives an up-to-date view of the document (so called “preview continuously” mode), updated on every page save.
latexmk -pvc yourdoc.tex opens a preview window that continuously reflects changes to the tex source
LatexMk comes as standard with the popular Windows tex installation (distribution) MikTeX, but is also available from its homepage http://www.phys.psu.edu/~collins/software/latexmk-jcc/ and also from CTAN (see latexmk entry in CTAN Catalogue) here (older, obsolete version 2 of the script can be found here). You may have to make some changes to the perl file as detailed in the INSTALL file.
The script runs on both UNIX and MS-WINDOWS (95, ME, XP, etc).
You can incorporate some of the latexmk commands into the AUCTeX
‘C-c C-c’ cycle (run command on current document) and/or Toolbar menu using
M-x customize-group auctex.
Compare with: rubber, latexn csh script, ShLaTeX bash script, prv Perl script derived from LatexMk v2.0; see also make-latex and latexmake Makefile macros/examples and old (2000) autoview EmacsLisp script, supposedly replaced by filewatch. All links here are to CTAN Catalogue entries at TUG. MikTeX distribution (Windows TeX implementation) has tool named