]> mj.ucw.cz Git - ads2.git/blob - all/preprocess
Korektury kapitoly o aproximaci.
[ads2.git] / all / preprocess
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 foreach my $f (@ARGV) {
7         my $d = $f;
8         $d =~ s@/[^/]*$@/@;
9         open X, $f or die;
10         while (<X>) {
11                 /^\\input .*lecnotes\.tex/ && next;
12                 /^\\references/ && next;
13                 /^\\bye/ && last;
14                 s@\\(figure|fig|inlinefig|epsfbox|IpeInput){([^}]+)}@\\$1\{$d$2}@g;
15                 s@\\(twofigures){([^}]+)}({[^}]+}{[^}]+}){([^}]+)}@\\$1\{$d$2}$3\{$d$4}@g;
16                 print;
17         }
18         close X;
19         print "\\chapterend\n";
20 }