Personal blog of Matthias M. Fischer


Three tools for collaborative TeX-ing

17 March 2022

Introduction

As a theoretician, I love to typeset my papers, reports, and even smaller notes with (La)TeX. Especially for writing larger mathematical formulas, it's just godsent -- I am literally not able to imagine using a word processor like MS Word for the same tasks instead.

One of LaTeX' drawbacks, however, lies in its lack of a "track changes" function, which is particularly useful for collaborative writing, and which many journals require for the submission of revised manuscripts. In the same vein, plain LaTeX also does not allow for the easy addition of comments to the page margins. Finally, and also related to the topic of editing TeX documents, when dealing with larger documents sometimes unused references keep accumulating which one may want to detect and remove sooner or later.

In this short post, I will briefly present three tools designed to deal with exactly these problems.

Tracking changes with latexdiff

To keep track of changes introduced to a tex file, one may use the tool latexdiff. Its usage is super simple. Just run

latexdiff oldfile.tex newfile.tex > diff.tex

to generate a nicely looking tex file which shows additions to the text in blue and deletions in red. An example output taken from here might look like:

Other formats are also available that lead to different styles and colours.

Adding margin notes with todonotes

To add notes to the margins of a tex file, use the package todonotes. Just include it to the tex file, and you're ready to go. The command \todo{} produces a new note, and its colours, font size, etc. can all be customised as well. Example output, taken from here:

Just recently, I also learned that one can use the command \listoftodos[Section Heading] to produce a new section that lists all todo notes in the respective document, as well as their positions.

Finding unused references with refcheck

Finally, using the package refcheck, one can easily identify unused references (be it references to the literature, equations, sections, or any other kind of reference). Just include the package in your tex file using \usepackage{refcheck} as well as the line \nocite{*}, and recompile. Unused references will then be underlined and marked with question marks the page margin:

(Picture taken from here)

Conclusions

Happy (collaborative) TeX-ing! :)