Skip to content

Instantly share code, notes, and snippets.

@napsternxg
Last active May 7, 2022 17:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save napsternxg/9e20d68dbd977573fb01c9e5a3f2bcdd to your computer and use it in GitHub Desktop.
Save napsternxg/9e20d68dbd977573fb01c9e5a3f2bcdd to your computer and use it in GitHub Desktop.
Doing diff for latex projects on Overleaf

Steps for doing latexdiff

  • Download 2 versions from overleaf
  • Compile them using the TexStudio. I should create a bbl file.
  • Create a new tex file where you replace the bibliography section with the contents of the bbl file.
  • Do the same for the other version of the file.
  • Check that the new tex file for both version compiles to the same contents of the original tex files.
  • Open https://3142.nl/latex-diff/ and paste the contents of the new tex files from both versions in the text boxes.
  • Click the box named "Generate LateX document showing differences"
  • It will take some time and then create the diff file.
  • Copy the diff contents to a file called diff.tex placed in the folder of the latest version.
  • Compile the diff.tex file. It may give errors. Manually fix the errors till the file compiles properly.
  • You should have your PDF with proper diff.

Note: If you do not want to use a personal latex editor like Tex Studio, you can simply create a blank project in overleaf and replace the contents of main.tex file with the diff.tex file and also include additional missing files required in diff.tex in the same project. This will give you the project file.

@t-pollington
Copy link

This is the problem I'm having "Manually fix the errors till the file compiles properly". Using latexdiff website is fine, it's just how to insert it back into Overleaf which is the problem.

@rosstex
Copy link

rosstex commented Dec 28, 2020

Everybody gangsta until the documentation says to fix all the errors manually

@adam-binks
Copy link

If you have multiple files and use \input to import them, this website won't be useful - I worked out how to LaTeX diff locally and wrote up some instructions here: https://gist.github.com/adam-binks/b8b1de266415df71cf10dbecad8cf54a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment