On Tue, Jan 08, 2002 at 12:40:02PM +0100, Herbert Voss wrote:
> On 8 Jan 2002, Xavier de Blas wrote:
> 
> > I' making versions of my thesis everymonth. I want to make a diff
> > between de results (pdf) for showing it to my thesis director.
> >
> > It's not a diff between de source (.lyx) it's a diff between de result.
> >
> > Anyone has done this? how?
> 
> There is a package bar (or so) which puts vertical
> bars at the margins.

The package is called changebar.sty
If you have file-old.lyx and file-new.lyx what you need to do is
  lyx -e latex file-old.lyx
  lyx -e latex file-new.lyx
  chbar.sh file-old.tex file-new.tex >file-diff.tex
  latex file-diff
  bibtex file-diff
  latex file-diff
  latex file-diff
  dvips file-diff  -o file-diff.ps

Personally, I use a script to process the .tex file (the attached lyxdiff2
script).
Also, I use a script to perform the above commands (actually, I keep my old
version using CVS, so the commands are a little bit different). 
This script is also attached (lyxdiff).
#!/usr/bin/tcsh
set f = $2:r

mv $2 $2.diff-bak
cvs update -r$1 $2
rm -f $f.tex
lyx --export latex $2
lyxdiff2 $f.tex >! $f-diff-1.tex

cvs update -A $2
mv $2.diff-bak $2
rm -f $f.tex
lyx --export latex $2
lyxdiff2 $f.tex >! $f-diff-1.tex

chbar.sh $f-diff-1.tex $f-diff-2.tex >! $f-diff-3.tex

latex $f-diff-3
bibtex $f-diff-3
latex $f-diff-3
latex $f-diff-3
set paper = `awk '/papersize/{print $2}' $2`
if ($paper == "letterpaper") then
    dvips -t letter $f-diff-3 -o $f-diff.ps
else
    dvips -t a4 $f-diff-3 -o $f-diff.ps
endif 

echo "\nerrors:"
grep "^\!" $f-diff-3.log

rm -f $f.tex $f-diff-1.tex $f-diff-2.tex $f-diff-3*
#!/usr/bin/perl
while (<>) {
    if (!/^%/) {
        $begin = 1 if (/begin{document}/);
        if ($begin) {
                s/ \n/\n/g;
                s/  / /g;
                s/(.) /$1\n/g unless (/&/);
        }
        print;
    }
}

Reply via email to