This post introduces how to use latexdiff to compare two versions of latex *.tex files, in order to visually mark changes to tex files.
(One colleague asked me about the usage of latexdiff, so I think it is a good time to write it up into a blog post to share with those who need some help with this.)
latexdiff is a Perl script and requires an installation of Perl 5.8 or higher.
Use latexdiff to mark differences and create a new LaTeX document with markup differences between two latex files.
- Linux (Ubuntu) users
latexdiff can be found in Ubuntu repository and detailed description of usage can be found here.
In your terminal, issue the commands below to install latexdiff.
sudo apt-get update sudo apt-get install latexdiff
# open your terminal, and cd to the tex files you need to compare # issue the following command latexdiff original_version.tex revised_version.tex > diff.tex
Run the diff.tex file like you run a normal tex file, you will see beautifully marked differences in the pdf file.
- Mac OS X users
$ latexdiff original_version.tex revised_version.tex > diff.tex
- Online latexdiff
- Multiple tex files for each version
If each version of your text files contains multiple (sub) tex files or if you want to use latexdiff with Git, check the reference lists for potential solutions.
Git and latexdiff: compare versions of LaTeX documents (pdf) — this is also about using git together with latexdiff