💾 Archived View for republic.circumlunar.space › users › johngodlee › posts › 2020-03-05-latex_track… captured on 2024-02-05 at 10:36:46. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2023-04-19)
-=-=-=-=-=-=-
DATE: 2020-03-05
AUTHOR: John L. Godlee
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 .pdf comments for those co-authors who are less keen on LaTeX.
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:
1: https://ctan.org/pkg/latexdiff
2: https://www.ctan.org/tex-archive/support/texdiff/
3: https://www.ctan.org/tex-archive/macros/latex/contrib/changes
4: https://www.ctan.org/tex-archive/macros/latex/contrib/changebar/
5: https://github.com/pedromateo/revdiff-LaTeX
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[6]. I imagine when I try it on a UNIX machine the process will be considerably more streamlined as perl is already installed.
6: https://tex.stackexchange.com/questions/165543/using-latexdiff-in-miktex
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 lstlisting style.
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 .pdf.
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 \usepackage[clean]{revdiff}.
The package requires you to download revdiff.sty and keep it somewhere it can be foundby each project, like ~/.texmf/.
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:
\newcommand{\todo}[1]{\textcolor{red}{\textbf{#1}}}
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 .pdf markup.
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 revdiff or changes to provide comments.