#!/usr/local/bin/perl # # David MacKay August 94 # should be given file.tex as argument $file = $ARGV[0] ; $filepdf = $ARGV[0] ; $filehtml = $ARGV[0] ; $file =~ s/\.tex/.ps.gz/g; $filepdf =~ s/\.tex/.pdf/g; $file2 = $file ; $file2 =~ s/\.ps/.ps2/ ; ; $filehtml =~ s/\.tex/.html/g; $titlegot = 0 ; $absgot = 0 ; $intitle = 0 ; $inabs = 0 ; $title = "" ; $abstract = "" ; while ( !($titlegot && $absgot) && ($_ = <>) ) { s/\%.*//g ; s/\\\\//g; if ( /title\{/ ) { s/\\title\{//g ; $intitle = 1 ; } if ( $intitle == 1 ) { if ( /\}/ ) {s/\}.*//g ;$intitle = 0 ; $titlegot = 1 ; } # $title .= $_ ; # } elsif ( /\\begin\{abstract\}/ ) { s/\\begin\{abstract\}.*//g ; $inabs = 1 ; } # doesn't handle kluwer \abstract{ } style. if ( $inabs == 1 ) { if ( /\\end\{abstract\}/ ) { s/\\end\{abstract\}.*//g ; $inabs = 0 ; $absgot = 1 ; } s/\-\-/-/g ; $abstract .= $_ ; } } # $title =~ s/\\b//g; $title =~ s/\$//g; $title =~ s/\s*\n\s*/\n\t/g ; $title =~ s/^\s*/\t/g; # $abstract =~ s/\\b//g; $abstract =~ s/\$//g; $abstract =~ s/\s*\n\s*/\n\t/g ; $abstract =~ s/^\s*/\t/g; print"
\n"; print $abstract ; print "
\n"; print "\n"; print 'postscript (Cambridge UK).'; print "
\n"; print "\n\n" ; print 'postscript (Canada mirror).'; print "\n
\n"; print "\n"; print 'pdf (Cambridge UK).'; print "
\n"; print "\n\n" ; print 'pdf (Canada mirror).'; print "
\n"; print "\nAll postscript files are compressed with gzip - \n" ; print 'see this page for advice about gzip, if needed.'; print "\n
\n"; if ( $treesave ) { print 'tree-saving postscript (2 pages per page -> half the number of pages).'; } print "\n