I'm making final corrections to my thesis and, as others (e.g. here and here, on this site) have mentioned, showing the changes you've made from one file to the next to supervisors/examiners is extremely useful.

Unfortunately, my files seem too big and complex for latexdiff to work. I have tried using latexFlatten and creating a ld.cfg file, both solutions mentioned in the above links. I have also tried using sed to remove all caption, listing and equation environments as these seem to be causing the problems.

But I simply cannot make it work and am thinking: there must be a simpler solution actually involving latexdiff and some intelligent tag.

So I've created a reproducible example (apologies it is not simple): my old project can be downloaded from here; my new one can be downloaded here. Assuming you unzip the files in a Unix home directory and start in the directory of the new thesis (cd ~/thesisNew/), the following should reproduce my problems:

   latexdiff --flatten ../thesisOld/Thesis.tex Thesis.tex > dif.tex

As you will see dif.tex does not compile, and much of the text is garbled.

I'm at my wit's end with this and hoping it'll be of use to others tearing their hair out at the performance of latexdiff with big projects like theses.

  • Anyone at least able to reproduce the errors? It's strange how the document seems to loose its structure, with unfinished environments etc. Perhaps I should convert it into something else (e.g. markdown) before trying to track the changes? – RobinLovelace Dec 19 '13 at 12:04
  • It seems to compile fine for me. I get no errors. – user10274 Dec 22 '13 at 12:58
  • I confirm - it does work: think my problem was using latexdiff 0.5. The current version is 1.0.3 and yes it seems to work fine now, although with latexdiff-so: latexdiff-so --flatten ../thesisOld/Thesis.tex Thesis.tex > dif.tex – RobinLovelace Dec 22 '13 at 19:36

»Doesn't work« is not really helpfull, but I hit limitations of the latexdiff and found it very helpfull to put those lines into the preamble of my document:

\providecommand{\DIFadd}[1]{{\protect\color{blue}#1}} %DIF PREAMBLE
  • can you explain that? – Jonas Stein Jun 26 '17 at 15:40
  • @JonasStein latexdiff used (don't know, if this is the case still today) the soul package. Those definitions flattened an issue caused by soul. – Keks Dose Jun 26 '17 at 16:13

For my large project, I first use this Python script to flatten my thesis. It doesn't recursively flatten, which is good for me, because I have a lot of nested tikz figures in standalone environments which cause problems. I then run latexdiff without the flatten option. This seems to work reasonably well, even with relative directories

  • 1
    Your link doesn't work anymore. I have a problem with tikzpictures and git-latexdiff: when I compile, I get an error message on tikzpictures cannot write on <file>.md5. How did you get rid of tikzs? Cheers – fmonegaglia Apr 25 '16 at 16:08
  • 1
    Hey @fmonegaglia, sorry I don't remember the process I went through very well. I did a quick Google search for "python flatten latex" and got this. Good luck to you! – abroekhof Apr 30 '16 at 6:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.