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.
Prepare revised version
Prepare a revised TeX file. For example, the name of the revised file is Check_document.tex.
Run latexdiff
Use the official latexdiff documentation when you need upstream details about command options or troubleshooting.
Official documentationOpen the terminal in the manuscript directory where both TeX inputs are available.
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.
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 |
If you run into an encoding problem, enter the following command instead:
latexdiff --math-markup=0 old_version.tex revised_version.tex | Out-File -Encoding utf8 diff_version.tex
After running latexdiff in the terminal, diff_version.tex will be generated.
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.
Confirm that all of the following are true:
old_version.texandrevised_version.texrepresent the two manuscript states you actually want to comparediff_version.texwas generated without confusion about the input fileslatexmk -pdf diff_version.texproduced a readable redlined PDF