Track changes with LaTeX

Many of us in academia have chosen to move away from word processing packages, using LaTeX to produce papers. There are a number of advantages to using LaTeX to produce written work, particularly if there are numerous, complex equations. I personally cannot stand using a standard word processor anymore, and get quite grumpy with co-authors who insist on dragging me into the world of Word, Excel and other hard drive- and system resource-gobbling programs. The major drawback to using LaTeX is the lack of a “track-changes” option. But, as always with open-source projects, there is an app for that.

In fact, there are several packages and tools that can be used it identify differences between one version of a .tex document (i.e. the LaTeX source files) and another. In fact, the easiest to use seems to be latexdiff, a script that comes with most LaTeX distributions. The implementation of the script requires use of the terminal window, but is otherwise trivial.

I recently tried it while revising a paper of Earth Surface Processes and Landforms. The procedure involves opening a terminal window and navigating to the folder where you have the original .tex file (“old.tex”) as well as the revised one (“new.tex”). That is the hard part. Once you have found your way to the right folder, you can simply run the command

>> latexdiff old.tex new.tex >diff.tex

This creates a new file (“diff.tex”) that can be compiled using your regular LaTeX editor, and which highlights changes that have been made. This means you can edit away to your heart’s content, not worrying about keeping track of the changes as you go. When you are done, simply compare the final revised version to the original one using latexdiff and compile the diff.tex file. This tool is amazingly simple and all researchers using LaTeX should be aware that such packages exist.

I have uploaded a few pages of the document I am currently working on, so that you can see what the marked up pdf looks like. (click here)

Published by

brett eaton

Brett Eaton is a professor in the Department of Geography at UBC, and the Associate Dean for Research and Graduate Studies in the Faculty of Art. He is interested in the natural processes shaping the Earth's surface, developing innovative teaching methods, and building/riding bicycles of all sorts.

One thought on “Track changes with LaTeX”

  1. That’s a wonderful post !
    I am in LaTeX for 10+ years, can sense my mercury rising with every paragraph I type on MS-Word, and shamelessly propagate for LaTeX. However, this is a really… really useful package that you mentioned. Was searching for something of the sort for years. ShareLaTeX has a solution– but not free for everyone.
    Read your post today, and implemented it immediately.
    `latexdiff` worked marvelously !
    Thank you Brett– Do keep educating us with lots and lots of such useful things. Cheers to your share once more.

Leave a Reply

Your email address will not be published. Required fields are marked *

Spam prevention powered by Akismet