If you want to easily highlight the changes between different versions of a latex document, there is a really handy pearl script to do (almost) all the work for you: latexdiff.
Download the source latexdiff.
Adjust the INSTALLPATH in the Makefile to a directory of your choice (which should also be put into your PATH environment variable).
Run make install .
- In the simplest case, a document highliting the difference between two versions of a latex file can be created with:
latexdiff document_old.tex document_new.tex > document_with_diffs.tex
- and running (pdf)latex on the output.
- If you use a version control system to keep track of changes in your document, you can even use latexdiff-vc (vc = version control) to highlight changes accross revisions, for example to see the changes since svn revision 29:
latexdiff-vc --svn -r 29 document.tex > document_with_diffs.tex
Supported version control systems are cvs, git, rcs and svn. If you add the option --ps (--pdf), the postscript (pdf) output from the difference file will be generated automatically, too.
For a latex document consisting of multiple files, run the command on your main document with the --flatten option:
latexdiff --flatten main_old.tex main_new.tex > main_with_diffs.tex
- (Note: it might be that you have to put the preamble into the main document. Also, multiple levels of nested includes are not supported.)
Using latexdiff with a multiple-file latex document and version control can get a little tricky. For git, there is a nice solution called git-latexdiff which internally checks out the revisions you want to compare and calls latexdiff with the --flatten option.
For svn, latexdiff-svn-multi seems to fulfill a similar purpose.
In any case, you can always accomplish the same by manually checking out the old revision to a temporary directory and use latexdiff to compare your version copy with that path.