Skip to content

Instantly share code, notes, and snippets.

@vbajpai
Last active April 17, 2021 18:02
Show Gist options
  • Save vbajpai/5402795 to your computer and use it in GitHub Desktop.
Save vbajpai/5402795 to your computer and use it in GitHub Desktop.
latex diff old with new
Create a diff of the new PDF to the old PDF. This flattens the LaTeX structure before diff'ng the contents.
$ latexdiff --flatten old.tex new.tex > diff.tex
$ latexmk -pvc -f -pdf -quiet diff.tex
Environments can also be ignored using the config command
$ latexdiff --config="PICTUREENV=(?:picture|DIFnomarkup|figure|lstlisting)[\w\d*@]*” \
--flatten old.tex new.tex > diff.tex
$ latexmk -pvc -f -pdf -quiet diff.tex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment