Friday, November 1, 2013

latexdiff a diff tool for Latex documents

IMHO, If you want a diff of two latex file then latexdiff is a reliable tool to do that.
It also supports included .tex files in the main operating file.

To install latexdiff:
$ sudo apt-get install latexdiff

Invoke latexdiff using following command:
$ latexdiff  --flatten  /path/to/old-version/main.tex   /path/to/new-version/main.tex  >  difffile.tex

(the --flatten argument is used to recursively get inputs from any included .tex files.)

To generate PDF file use following commands:
$ pdflatex difffile
$ bibtex difffile
$ pdflatex difffile

Hope this helps!