Highlighting changes in latex documents

I find it a lot easier to write my papers in latex, but sometimes collaboration can become tricky.

Occasionally I would like to see what the changes are between two different versions of a latex file, and until now I didn't really have a good way. Using wdiff and colordiff packages one can easily track the changes as they appear in color on the terminal. For example:

wdiff KGI.tex KGI_MB.tex | colordiff

will show the deletions in red and additions in blue:

...thickness [-and-] {+as well as+} measured surface...

Keep in mind that if the brackets are not in the same line (eg: [- multiple lines of text -]), then colordiff may not set the correct color.

 UPDATE: 29 January 2014

If you like to send these files to someone, you can use the aha package from Ubuntu repositories to convert ansi colors to html. Something like the following does the trick:

To install:

sudo apt-get install aha

To generate the HTML files:

wdiff tc-2013-117-discussions-20140120.tex tc-2013-117-discussions-20120122Paco.tex | colordiff | aha > diff_20120122Paco-20140120.html
colordiff tc-2013-117-discussions-20140120.tex tc-2013-117-discussions-20120122Paco.tex | aha > colordiff_20120122Paco-20140120.html

Please note that since wdiff/colordiff can miss some multiline insertions deletions, it is a good idea to prepare a regular diff using colordiff as well. Also note that old file goes first. (i.e. colordiff oldfile newfile).