On Thu, Jun 26, 2014 at 10:52:43AM +0100, Pawel Moll wrote: > On Wed, 2014-06-25 at 19:29 +0100, Michael S. Tsirkin wrote: > > On Wed, Jun 25, 2014 at 01:54:24PM +0100, Pawel Moll wrote: > > > On Wed, 2014-06-25 at 13:24 +0100, Michael S. Tsirkin wrote: > > > > OK I will try this but I note this gives us back > > > > DIFaddbegin/DIFaddend. > > > > You are saying with egingroup/endgroup color stack > > > > overflow errors go away? > > > > > > Yes. Commands like color apply to a single group, usually marked with > > > curly brackets {xxx}, with group and egingroup (there's some subtle > > > difference I don't really understand; enough to say that group didn't > > > work for me ;-). I have no idea why are they pushed to a stack, if there > > > seem to be no pop operation, but just enclosing a change in a separate > > > group seems enough. That's what my first proposal did (notice extra {} > > > in DIFaddtex), but as you pointed out it missed some bits. > > > > > > > How about footnotes? > > > > Is there a way to fix them without an external script? > > > > Would be nice if the footnote mark was also crossed-out ... > > > > > > Right, my first version did it, then I forgot to check it. Anyway, this > > > (slightly suboptimal, but I couldn't care less) should cover all cases > > > (I see footnotes on page 59 coloured): > > > > Hmm fails build for me > > [46] > > Chapter 5. > > ! Missing endgroup inserted. > > <inserted text> > > endgroup > > l.3613 DIFaddbegin DIFadd{18 }& > > DIFadd{Input device }\ > > Have you added > > --config "FLOATENV=(?:figure table tabular plate)[wd*@]*" > > to the latexdiff command line? (I mentioned that in one of the mails > before. OK I pushed what I have into svn for now. Still tweaking it, current is r392 This is the patch on top, if I apply it I can not create the pdf. diff --git a/diffpreamble.tex b/diffpreamble.tex index 6242878..0a674a0 100644 --- a/diffpreamble.tex +++ b/diffpreamble.tex @@ -4,27 +4,23 @@ %DIF FONTSTRIKE PREAMBLE RequirePackage[normalem]{ulem} -providecommand{DIFadd}[1]{{sf #1}} -providecommand{DIFdel}[1]{{footnotesize sout{#1}}} +providecommand{DIFaddtex}[1]{color{pinegreen}sf #1} +providecommand{DIFdeltex}[1]{color{red}footnotesize sout{#1}} %DIF END FONTSTRIKE PREAMBLE - %DIF COLOR PREAMBLE RequirePackage{color} -providecommand{DIFaddbegin}{protectcolor{blue}hypersetup{linkcolor=blue,urlcolor=blue}} -providecommand{DIFaddend}{protectcolor{black}hypersetup{linkcolor=pinegreen,urlcolor=pinegreen}} -providecommand{DIFdelbegin}{protectcolor{red}hypersetup{linkcolor=red,urlcolor=red}} -providecommand{DIFdelend}{protectcolor{black}hypersetup{linkcolor=pinegreen,urlcolor=pinegreen}} +providecommand{DIFaddbegin}{egingroupcolor{blue}} +providecommand{DIFaddend}{endgroup} +providecommand{DIFdelbegin}{egingroup +color{red}hypersetup{linkcolor=red,urlcolor=red}} +providecommand{DIFdelend}{hypersetup{linkcolor=blue,urlcolor=blue}endgroup} %DIF END COLOR PREAMBLE -providecommand{DIFaddtext}[1]{ extcolor{blue}{sf #1}} -providecommand{DIFdeltext}[1]{ extcolor{red}{footnotesize sout{#1}}} - -%DIF FLOATSAFE PREAMBLE: SEEMS UNUSED BUT JUST IN CASE -providecommand{DIFaddFL}[1]{DIFadd{#1}} -providecommand{DIFdelFL}[1]{DIFdel{#1}} -providecommand{DIFaddbeginFL}{} -providecommand{DIFaddendFL}{} -providecommand{DIFdelbeginFL}{} -providecommand{DIFdelendFL}{} -%DIF END FLOATSAFE PREAMBLE +% Standard DIFadd and DIFdel are redefined as DIFaddtex and +DIFdeltex +% when hyperref package is included. +%DIF HYPERREF PREAMBLE +providecommand{DIFadd}[1]{ exorpdfstring{DIFaddtex{#1}}{#1}} +providecommand{DIFdel}[1]{ exorpdfstring{DIFdeltex{#1}}{}} +%DIF END HYPERREF PACKAGE %% diffpreable.tex end diff --git a/makediff.sh b/makediff.sh index 460b593..6657292 100755 --- a/makediff.sh +++ b/makediff.sh @@ -35,5 +35,5 @@ sed 's/\footnote{/\footnote {/' new/flat.tex > new/flat-fixed.tex #cp new/flat.tex new/flat-fixed.tex #wget
http://mirror.math.ku.edu/tex-archive/support/latexdiff/latexdiff-fast #chmod +x latexdiff-fast -latexdiff-fast --append-safecmd=field --ignore-warnings -p diffpreamble.tex old/flat-fixed.tex new/flat-fixed.tex > virtio-diff.tex -perl -pi fixupdiff.pl virtio-diff.tex +latexdiff-fast --config "FLOATENV=(?:figure table tabular plate)[wd*@]*" --append-safecmd=field --ignore-warnings -p diffpreamble.tex old/flat-fixed.tex new/flat-fixed.tex > virtio-diff.tex +#perl -pi fixupdiff.pl virtio-diff.tex