Oskar Pettersson bio photo

Oskar Pettersson

Researcher in SECOs and TEL. Coder, beer geek and runner in decline.

Twitter Github

LaTeX and its tool chain is my preferred way of writing publications. However, not everyone like it as much as I do obviously, and many have no idea how to use it. So when someone asks what has been changed since the last revision, telling them to check out the previous version of the file from the repo and diff it with the current file, is just not a viable option. So what can be done to include people like this in your authoring process in this particular case?

There are a few ways to achieve this. One way is to simply compare the pdf files using tools like the open source tool DiffPDF. This is not optimal in my case however. My workflow includes a heavy reliance on git during the writing process and checking out various files and compiling them for comparison is simply to slow. At least for me.

Finally I found the Git-latexdiff which is a wrapper for latexdiff but with a better Git support. This tool allows you to diff two different revisions of your LaTeX project and output a pdf with the changes. The syntax for this particular use case can be seen below. -b stands for Bibtex and -o for output.

git-latexdiff -b -o filename.pdf --main filename.tex old-revision new-revision

An example from a recent project of mine looks as follows

git-latexdiff -b -o thediff.pdf --main rev2.tex 67e2 3c2d