I have recently submitted a paper and got reviews back with minor changes before publication, YAY! The journal thankfully supplied a LaTeX template for writing the paper which made me very happy, so I wrote the paper in LaTeX and have been using
vimdiff to collaborate with co-authors, for those co-authors who are willing to edit
.tex files, and using
Now I have to reply to the reviewers' comments and supply a revised version of the manuscript. They recommend on the website using “track changes” to make the changes clear in the manuscript, however LaTeX doesn’t have this functionality, not being a WYSIWYG editor. If I was being smarmy I would recommend they use a plain-text diff utility, but that’s probably not a good way to make friends. So I am now looking for a way to do “track changes” in LaTeX.
I have found a few notable options while searching the internet:
- A Perl program which automatically diffs and highlights changes between 2
.texfiles, conveniently includes
--flattenif document is divided into separate files using
\includestatements. See also texdiff , a less complex option.
- A TeX package which allows manual markup with changes as comments in the gutter. Conveniently supplies the
finaloption to the package declaration, which clears markup.
- changebar - Adds simple highlighted bars where text has been changed.
- revdiff - A LaTeX package which is built specifically with the goal of making the work of reviewers of papers easier by marking changes in the text, adding tags and comments.
- Manually declare highlight options with
This tool is handy because it automates most of the diff-ing between two .tex files, providing simple red strikethrough lines when text is removed and blue if text is added. I found that this small utility doesn’t handle complex changes well though, and is best suited to smaller edits like spelling and word choice. When whole paragraphs start moving around, a manual commenting system is still required, understandably.
I had some small issues getting this to run on the Windows machine I am using while working away from home, but I found this Stack Overflow page very helpful in providing a solution . I imagine when I try it on a UNIX machine the process will be considerably more streamlined as perl is already installed.
A manual change highlighter, which is well developed. I ran into a few conflicts with definition of the
\highlight command, which I think came from the
listings package, but this was solved by redefining my
This package adds:
It also provides the
\listofchanges command which is similar to the list of figures output.
It provides options to clear the markup using the
final option in the package declaration. There are a bunch of other package options which change what markup is shown in the output
revdiff is another manual change highlighter. I guess the value of manual change highlighters is when a single author is preparing a document to send back to reviewers, so they can see how you have implemented changes. It comes with a few basic functions:
It provides an option to remove markup and display the new version with
The package requires you to download
revdiff.sty and keep it somewhere it can be foundby each project, like
It’s unfortunate that comments appear inline rather than in the gutter like “track changes”.
If your needs are simple, it’s not difficult to create a couple of custom commands which style the enclosed text to show if something has been deleted or added. I’ve done this for a long time to add TODO notes for myself, using:
The only option I found which didn’t give me any issues, and the one I ended up using for this project, was
revdiff, which contains the minimum of commands I need and produces smart looking
For future projects I think I will try and make sure that I will try to incorporate
latexdiff into my workflow from the start. If I change my editing technique then
latexdiff will be able to handle all of this automatically. Possibly if I have one round of
latexdiff and then also use
changes to provide comments.