== Ruby LaTeX Diff

This +rblatexdiff+ program compares LaTeX source files for changes and outputs
an annotated LaTeX file that highlights the edited content. It tries to do this
accurately by tokenising and parsing the LaTeX document. Unfortunately this
process isn't precise because of the nature of the TeX language. Even so, it
can do a pretty good job.

A 'preamble' LaTeX file is inserted just before the <tt>\begin{document}</tt>
line in the output file. This declares some extra LaTeX commands that are used
in the annotated text. The default style provided is small red text for deleted
content and blue text for added content. Changebar lines are added in the right
margin. You can edit the preamble file to suit your style preferences.

A LaTeX changebars package (<tt>pschangebar.sty</tt>) is also provided. The
output is also compatible with the +changebar.sty+ and +dvipost+ changebar
support, however it has not been tested thoroughly.

== Requirements
 
  * ruby 1.8.2
  * GNU diff with --GTYPE-group-format support (known working with 2.8.1)
  * LaTeX
  * dvips
  * ps2pdf

Note that pdflatex is not directly supported since the creation of changebars
using the supplied 'pschangebar' LaTeX package requires a PostScript
interpreter.

== Getting started

Get your old and new LaTeX files. If you have one main file that includes other
files, you may be able to flatten them using the +rblatexflatten+ tool. Ensure 
that the +TEXINPUTS+ environment variable is set appropriately if necessary.

Here's a sample invocation of the +rblatexdiff+ tool, run from the package
directory. This assumes a Bourne-style shell (for the environment variable
setting).

  bin/rblatexdiff --preamble sty/pscbpreamble.tex oldfile.tex newfile.tex > changes.tex
  TEXINPUTS=.:sty: latex changes.tex
  DVIPSHEADERS=.:sty: dvips -Ppdf -o changes.ps changes.dvi
  ps2pdf changes.ps

This should give you 'changes.pdf'. If you don't want the red removed material
to be shown, add +--omit-del+ to the rblatexdiff command line.

The above command can be found in the script +run-diff.sh+ in the +sample+
directory.

== Acknowledgements

Heavily inspired by http://www.ctan.org/tex-archive/support/latexdiff/.

== Author

Jonathan Paisley <jp-www@dcs.gla.ac.uk>

