Track Revisions While Editing LaTeX Documents

How track changes works in LaTeX: diff tools, markup packages and editor features compared, with what each changes, how output behaves when copied, and when a clean copy is better.

LaTeX has no built-in revision tracking like a word processor. Tracking edits in a LaTeX document means choosing one of three methods: comparing two versions after the fact, marking changes by hand as you write, or using an editing platform that records changes for you. This review explains what each method changes, how the marked-up result holds up when it is copied or shared, and when a plain, clean version is the better thing to send.

Is LaTeX revision tracking suitable for your use?

For reviewers who need to see what changed between drafts, such as co-authors, editors or journal referees reading a response to review, revision tracking in LaTeX works well. Its main benefit is a compiled PDF where additions and deletions are visibly distinguished, so readers do not have to compare two documents line by line.

The main tradeoff is that the marked-up output is a review artifact, not a finished document. Deleted and inserted text sit side by side. Color and strikethrough carry the meaning, and complex material such as equations, tables and custom macros can confuse the marking or stop the file from compiling. A plain, clean version is better for publication, archiving, text reuse, search indexing, and any reader who depends on assistive technology or cannot distinguish the colors used.

What "track changes" means in a LaTeX workflow

In a word processor, track changes is editor metadata attached to the document. In LaTeX, the phrase can mean three different things, and they change different layers of your work.

  • Diff after the fact: a comparison tool reads an old and a new .tex file and writes a third .tex file. That file contains both versions, with markup commands around the differences. latexdiff is the widely used tool of this type.
  • Manual markup while writing: a package such as changes provides commands like \added, \deleted and \replaced. You wrap your edits in them as you write, and the package renders them in color, optionally with author identification.
  • Editor-level tracking: some collaborative LaTeX editors, Overleaf among them, offer a track-changes mode. It records edits in the editing environment rather than requiring markup commands in your source.

What each method actually changes

The key distinction is between stored source and visual presentation. Underlines, strikethrough and color in the PDF are presentation. What changes in storage depends on the method.

A diff tool leaves your original files alone and creates a new source file full of inserted commands. Commands that latexdiff adds include \DIFadd and \DIFdel. You compile that generated file to get the marked-up PDF. Your working source stays clean, but the diff file is not meant for further editing.

latexdiff draft-v1.tex draft-v2.tex > draft-diff.tex
pdflatex draft-diff.tex

Manual markup puts the tracking commands directly into your working source. The text you see while editing therefore contains both old and new wording until you remove the commands. The changes package offers a final option that hides the markup when compiling, so you can produce a clean PDF without editing the source. The commands stay in the file until you strip them, though.

\usepackage{changes}
% \usepackage[final]{changes}  % compile without markup

The results were \replaced{statistically significant}{notable}
across \added{all three} trials\deleted{ in most cases}.

Editor-level tracking keeps the record of changes in the editing platform. Whether that record survives when you download, export or move the project to another tool depends on the platform. The evidence for this review does not confirm how any specific editor handles tracked changes on export, so check this in the current documentation before relying on it.

Method | What is stored | Where markup appears | Clean copy
Diff tool (e.g. latexdiff) | A separate generated .tex file; originals untouched | Compiled diff PDF | Your existing new version
Markup package (e.g. changes) | Tracking commands inside your working source | Compiled PDF; hidden with the final option | Compile with final, or remove the commands
Editor-level tracking | Change record held by the editing platform | Inside the editor interface | Accept or reject changes, then export

Will the marked-up result stay readable after copying or sharing?

The compiled PDF is the most portable form, and it looks the same for anyone who opens it. Its usability beyond reading is limited, for the following reasons.

  • Copy and paste: struck-through deletions are still text in the PDF. Copying a passage will usually pick up the deleted and inserted wording together, with nothing to tell them apart once the formatting is gone.
  • Search: searching the PDF can match words that were deleted, which can mislead someone checking whether a term is still in the document.
  • Reading order: deletions placed inline next to additions make sentences hard to follow when read aloud or pasted as plain text.
  • Color dependence: if color is the only signal, readers with color-vision differences, and anyone printing in grayscale, may lose the distinction. Packages that combine color with underline or strikethrough reduce this risk.
  • Assistive technology: no tested evidence was supplied on how specific screen readers announce strikethrough or colored text in LaTeX-generated PDFs. Do not assume deletions will be conveyed as deletions.
  • Compilation fragility: diff markup inside equations, tables, figure captions or heavily customized macros can fail to compile or render oddly. latexdiff has options that affect this, including how math is marked and whether files pulled in with \input are merged first. Check its documentation for your version.

A plain-text or clean equivalent is needed whenever the text will be reused, quoted, indexed, archived as the record, or read by someone who cannot rely on visual formatting. A common practice is to send the marked-up PDF together with a clean PDF of the same version, and to list substantive changes separately in prose when the audience includes referees or assistive-technology users.

Identifying the effect and finding a way to produce it

If you have received a LaTeX PDF with blue underlined additions and red struck-through deletions and want to reproduce it, it was most likely made with a diff tool or a markup package. A uniform style of markup throughout the document, with no author labels, suggests a generated diff. Author initials, margin notes or a list of changes point to a markup package.

  • To compare two finished versions, search for "latexdiff". It is distributed with major TeX distributions and can also be installed separately.
  • To compare versions stored in Git, search for "git-latexdiff" or for latexdiff's own version-control helpers.
  • To mark edits as you write, with author attribution, search CTAN for the "changes" package. The older "trackchanges" package is another search term.
  • For tracking inside a collaborative online editor, look in that editor's review or track-changes settings. Menu names and locations change between releases, so confirm them in the editor's current help pages.

Limits of this review

No subject-specific test results, version numbers or platform documentation were supplied for this article. The descriptions above reflect general, documented behavior of the named tools. They are not verified observations in a particular setup. Option names, editor menus, export behavior and assistive-technology handling should be confirmed against current documentation, or with a short test document, before you build a workflow around them.