Site icon texblog

Track changes with latexdiff

Track changes is a popular tool in Word. If you are looking for something similar for LaTeX latexdiff is the answer. For example if you are an academic researcher submitting papers to journals, you will most likely have to go through stages of revisions. Each time you will probably have to submit a marked-up document with all the changes. latexdiff will do that for you with minimal effort.

latexdiff is a Perl script. If you are on a Mac, Perl and latexdiff will most likely be already installed. On a Windows machine you might need to install them.

Using latexdiff is very simple. My two tex documents are called old.tex and new.tex. I am interested in how the document changed from the old to the new version. All you need to do is put the following two lines of code to created and compile the diff-file.

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

The marked-up document diff.pdf will look like this:

A number of different mark-up styles are available. To change the type of the mark-up style use the following code.

latexdiff -t TYPEOPTION old.tex new.tex > diff.tex
pdflatex diff.tex

TYPEOPTION can be any of the following:

The default type is UNDERLINE. Many more options are available to customize your diff-file. Refer to the latexdiff package manual to learn more.

Be aware: if you change an image, but not its name <a href="https://ctan.org/pkg/latexdiff?lang=en">latexdiff</a> will not highlight this as a change. However it will highlight it if you change the name of the image, but not the image itself.

Exit mobile version