2 # make sketch documentation with Windows and Cygwin
7 our $GS = "gswin32.exe";
8 our $MEM_OPTION = "--extra-mem-top=5000000"; # MikTeX 2.7
9 # our $MEM_OPTION = ""; # MikTeX 2.6
13 die "missing example name" unless $ex;
14 my %arg = map { $_ => 1 } @_;
16 unless ($arg{nosketch
}) {
17 my $cmd = "sketch -D $ex manexamples.sk > $ex.tex";
18 print STDERR
"$cmd\n";
19 system($cmd) == 0 or die;
21 unless ($arg{nobitmaps
}) {
22 print STDERR
"latex example '$ex-tmp.tex':\n";
23 system("sed -e s/TEXFILE/$ex/ makeex-tmp.tex > $ex-tmp.tex") == 0 or die;
24 system("latex $MEM_OPTION $ex-tmp.tex") == 0 or die;
25 system("dvips -E $ex-tmp -o tmp.eps") == 0 or die;
26 # fix up bounding box (originally this was not necessary; something was "improved")
27 system("epstool --copy --bbox tmp.eps $ex.eps") == 0 or die;
30 open(F
, "> $ex.txt") or die;
31 print F
"Image $ex omitted in text version of this document.";
33 system("$GS -q -dQUIET -dNOPAUSE -dBATCH -dEPSCrop -sDEVICE=pdfwrite -sOutputFile=$ex.pdf -r120 $ex.eps") == 0 or die;
34 system("$GS -q -dQUIET -dNOPAUSE -dBATCH -dEPSCrop -sDEVICE=png256 -sOutputFile=$ex.png -r120 $ex.eps") == 0 or die;
40 my %arg = map { $_ => 1 } @_;
43 open(F
, "tags.sk") or die;
51 unless ($arg{notypeset
}) {
53 system("makeinfo sketch.texi") == 0 or die;
55 print "html, one page per node:\n";
56 system("makeinfo --html sketch.texi") == 0 or die;
58 copy
($_, "sketch/$_");
61 print "html, single page:\n";
62 system("makeinfo --html --no-split sketch.texi") == 0 or die;
64 # run twice to ensure labels are ok
66 system("texi2dvi sketch.texi") == 0 or die;
67 system("texi2dvi sketch.texi") == 0 or die;
69 print "Postscript:\n";
70 system("dvips sketch.dvi -o sketch.ps") == 0 or die;
72 # texi2dvi finds PNG before the PDF graphics, so delete...
73 my @unlink_list = <ex???
.png
>;
78 system("texi2dvi --pdf sketch.texi") == 0 or die;
82 copy
("sketch/$_", $_);
87 if (grep { /help/ } @ARGV) {
88 print "usage: perl make.pl [examples] [nosketch] [nobitmaps] [notypeset]\n";
90 elsif ($ARGV[0] =~ /^ex[0-9]+/ ) {