How to compare versions of a LaTeX project
Instructions tested on Mac OS
Tool: https://ctan.org/pkg/latexdiff
Using it with multi-file projects: https://tex.stackexchange.com/a/167894
Mac OS installation: https://tex.stackexchange.com/a/548553
With Overleaf:
- Go to "History"
- Select the old version > "Download project at this version"
- Select the new version > "Download project at this version"
- Unzip both files
- Run latexdiff
The command below:
- Processes subfiles
- Generates one output file (
--flatten
) - Handles commands that break the diff output if not flagged (
--append-textcmd=...
). For example the FIXme package)
latexdiff --append-safecmd="subfile" \
--append-textcmd="chrfatal,chrnote,dsquestion,dsanswer" \
old/main.tex new/main.tex \
--flatten > diff.tex