14

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. –  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

2 Answers2

2

»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
\providecommand{\DIFdel}[1]{{\protect\color{red}\protect\scriptsize{#1}}}
Keks Dose
  • 30,892
1

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

abroekhof
  • 111
  • 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 06:10