summaryrefslogtreecommitdiff
path: root/fixupdiff.pl
diff options
context:
space:
mode:
authormstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2014-06-26 12:35:01 +0000
committermstsirkin <mstsirkin@0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652>2014-06-26 12:35:01 +0000
commitfc27ea190b89ed5a654f9ccc326caff2558dc56f (patch)
treeabcd26b1763bde7ac107fd234c7bc89cb555be54 /fixupdiff.pl
parentb614cfed56a9f63c4247f33c36a29ad47a9a6c19 (diff)
more latexdiff hacks
- change link color from green to pinegreen. Looks better to me. - split footnotes out from their text, so that latexdiff does not consider them as a unit - mark field command as safe for latexdiff, otherwise it's not shown in red - hack adding DIFaddtext within footnotes could not handle case where latexdiff inserted multiple DIFadd within the footnote. Instead, detect when footnote is within DIFaddbegin/DIFdelbegin, add an extra DIFaddbegin/DIFdelbegin within the footnote. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> git-svn-id: https://tools.oasis-open.org/version-control/svn/virtio@391 0c8fb4dd-22a2-4bb5-bc14-6c75a5f43652
Diffstat (limited to 'fixupdiff.pl')
-rwxr-xr-xfixupdiff.pl25
1 files changed, 22 insertions, 3 deletions
diff --git a/fixupdiff.pl b/fixupdiff.pl
index 69d4e6e..ce30692 100755
--- a/fixupdiff.pl
+++ b/fixupdiff.pl
@@ -13,6 +13,25 @@ s/\\DIFdelbegin \\DIFdel{([^}]*)}\\DIFdelend/\\DIFdeltext{$1}/;
s/\\DIFaddbegin \\DIFadd{([^}]*)}\\DIFaddend/\\DIFaddtext{$1}/;
# external \color does not seem to apply to footnotes.
-# detect and replace with \textcolor within footnotes
-s/(\\footnote\s*{[^}]*)\\DIFadd{/$1\\DIFaddtext{$2/;
-s/(\\footnote\s*{[^}]*)\\DIFdel{/$1\\DIFdeltext{$2/;
+# detect and replace with \color within footnotes
+
+if (m/\\DIFaddbegin/) {
+ $diffadd=1;
+}
+if (m/\\DIFaddend/) {
+ $diffadd=0;
+}
+if (m/\\DIFdelbegin/) {
+ $diffdel=1;
+}
+if (m/\\DIFdelend/) {
+ $diffdel=0;
+}
+
+if ($diffadd) {
+s/(\\footnote\s*{)/$1\\DIFaddbegin{}/;
+}
+
+if ($diffdel) {
+s/(\\footnote\s*{)/$1\\DIFdelbegin{}/;
+}