Optional

Generate a redlined PDF

Use this workflow when a supervisor, collaborator, or reviewer needs a PDF that clearly marks what changed between two manuscript states.

Prepare old version

Save the earlier manuscript as old_version.tex. This should be the specific version you want to compare against, not a random backup. You need only the TeX file, not other files.

Example manuscript file saved as old_version.tex before running latexdiff

Prepare revised version

Prepare a revised TeX file. For example, the name of the revised file is Check_document.tex.

Current manuscript file prepared separately before running latexdiff

Run latexdiff

Open the terminal in the manuscript directory where both TeX inputs are available.

VS Code command palette with the Create New Terminal action

Then run latexdiff to generate diff_version.tex. Enter the following command in the terminal:

latexdiff --math-markup=0 old_version.tex revised_version.tex > diff_version.tex

Press Enter to run the command.

Terminal output after running latexdiff to produce diff_version.tex

By changing the number in --math-markup=<number>, you can adjust how precisely the changes inside equations are displayed.

Code Value Behavior
--math-markup=0 off Math changes not shown (current setting)
--math-markup=1 coarse Entire math environment compared as one unit
--math-markup=2 whole Whole environment marked if any change occurred
--math-markup=3 fine Fine-grained markup inside math expressions

After running latexdiff in the terminal, diff_version.tex will be generated.

Project folder showing the generated diff_version file

Compile the redlined file

Compile the generated TeX file:

latexmk -pdf diff_version.tex

If the compilation succeeds, you will get a redlined PDF with all changes marked as shown below.

Compiled redlined PDF showing highlighted manuscript changes

Before proceeding

Confirm that all of the following are true:

  • old_version.tex and revised_version.tex represent the two manuscript states you actually want to compare
  • diff_version.tex was generated without confusion about the input files
  • latexmk -pdf diff_version.tex produced a readable redlined PDF