summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fixupdiff.pl14
-rwxr-xr-xmakediff.sh8
2 files changed, 19 insertions, 3 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
new file mode 100644
index 0000000..70d4e30
--- /dev/null
+++ b/fixupdiff.pl
@@ -0,0 +1,14 @@
+my $lstlisting=0;
+while (<>) {
+ my $line = $_;
+ if (m/%DIFDELCMD\s+<\s+\\begin{lstlisting}/) {
+ $lstlisting=1;
+ }
+ if ($lstlisting) {
+ $line =~ s/%DIFDELCMD\s+<\s+//;
+ }
+ print $line;
+ if (m/%DIFDELCMD\s+<\s+\\end{lstlisting}/) {
+ $lstlisting=0;
+ }
+}
diff --git a/makediff.sh b/makediff.sh
index b7e6831..dc2efff 100755
--- a/makediff.sh
+++ b/makediff.sh
@@ -50,6 +50,8 @@ sed 's/\\footnote{/\\footnote {/' 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 --config \
-"FLOATENV=(?:figure|longtable|table|tabular|plate)[\w\d*@]*" \
- --append-safecmd=field --append-textcmd=mmioreg --ignore-warnings -p diffpreamble.tex old/flat-fixed.tex new/flat-fixed.tex > virtio-diff.tex
-#perl -pi fixupdiff.pl virtio-diff.tex
+"FLOATENV=(?:figure|longtable|table|tabular|plate|lstlisting)[\w\d*@]*,PICTUREENV=(?:picture|DIFnomarkup|lstlisting)[\w\d*@]*" \
+ --append-safecmd=field --append-textcmd=mmioreg \
+--ignore-warnings -p diffpreamble.tex old/flat-fixed.tex \
+new/flat-fixed.tex > virtio-diff-tofix.tex
+perl fixupdiff.pl virtio-diff-tofix.tex > virtio-diff.tex