3 $style = (@ARGV > 0)? $ARGV[0] : "a4ps";
5 open(IN, "z-rawindex") || die "Can't open z-rawindex\n";
6 open(OUT, ">z-contents") || die "Can't open z-contents\n";
10 .linelength ~~sys.linelength + 0.2in
11 .pagedepth ~~sys.pagedepth - 0.2in
21 .set p ~~sys.pagenumber
34 s/\$e\s*$//; # "see also" lines have no line number
35 s/--\s*\d+$//; # remove "extra" number for index page
37 s/\n$//; # trailing newline
42 print OUT ".if ~~sys.leftonpage < 2*~~sys.linedepth\n";
43 print OUT ".newpage\n";
45 print OUT "\$shead\{$_\}\n";
58 system("sgcal z-contents -to zc-gcode -style $style -index /dev/null");
61 system("sgtops zc-gcode -to zc-ps");
62 print "PostScript in zc-ps\n";
66 system("mv -f zc-gcode zc-txt");
67 print "Text in zc-txt\n";