]> mj.ucw.cz Git - ga.git/blob - all/preprocess
Importing initial version.
[ga.git] / all / preprocess
1 #!/usr/bin/perl
2
3 use warnings;
4 use strict;
5
6 print <<EOF ;
7 \\input ../sgr.tex
8 EOF
9 foreach my $f (@ARGV) {
10         my $d = $f;
11         $d =~ s@/[^/]*$@/@;
12         open X, $f or die;
13         while (<X>) {
14                 /^\\input .*sgr\.tex/ && next;
15                 /^\\bye/ && last;
16                 s@\\(figure|epsfbox){([^}]+)}@\\$1\{$d$2}@g;
17                 print;
18         }
19         close X;
20         print "\\bigbreak\\bigbreak\n";
21 }
22 print <<EOF ;
23 \\bye
24 EOF