diff --git a/Autoformat.pm b/Autoformat.pm index 7fe33c0..62dd939 100644 --- a/Autoformat.pm +++ b/Autoformat.pm @@ -521,8 +521,8 @@ sub entitle { s/ ( [:;] \s+ ) ($alword) /$1 . recase($2,'title')/ex; } -my $abbrev = join '|', qw{ # modified by JS: add al. and Jr. +my $abbrev = join '|', qw{ etc[.] pp[.] ph[.]?d[.] U[.]S[.] al. Jr. }; diff --git a/DEPENDENCIES b/DEPENDENCIES new file mode 100644 index 0000000..ba8bb2a --- /dev/null +++ b/DEPENDENCIES @@ -0,0 +1,6 @@ + required: +gnuplot +latex +graphviz + optional: +gv diff --git a/make-latex.pl b/make-latex.pl index 22bea3b..f820265 100755 --- a/make-latex.pl +++ b/make-latex.pl @@ -36,27 +36,28 @@ my $seed; my $remote = 0; my $title; +my $pdfview; sub usage { select(STDERR); print < An author of the paper (can be specified + --author An author of the paper (can be specified multiple times) --seed Seed the prng with this --file Save the postscript in this file --tar Tar all the files up - --savedir Save the files in a directory; do not latex + --savedir Save the files in a directory; do not latex or dvips. Must specify full path --remote Use a daemon to resolve symbols --talk Make a talk, instead of a paper --title Set the title (useful for talks) --sysname <name> Set the system name - + --pdfview <name> name of PDF viewer EOUsage exit(1); @@ -66,8 +67,8 @@ sub usage { # Get the user-defined parameters. # First parse options my %options; -&GetOptions( \%options, "help|?", "author=s@", "seed=s", "tar=s", "file=s", - "savedir=s", "remote", "talk", "title=s", "sysname=s" ) +&GetOptions( \%options, "help|?", "author=s@", "seed=s", "tar=s", "file=s", + "savedir=s", "remote", "talk", "title=s", "sysname=s" , "pdfview=s") or &usage; if( $options{"help"} ) { @@ -87,6 +88,10 @@ sub usage { } else { $seed = int rand 0xffffffff; } +if( defined $options{"pdfview"} ) { + $pdfview = $options{"pdfview"}; +} + srand($seed); my $name_dat = {}; @@ -249,7 +254,14 @@ sub usage { system( "ps2pdf $ps_file $pdf_file; acroread $pdf_file" ) and die( "Couldn't ps2pdf/acroread $ps_file" ); } else { - system( "gv $ps_file" ) and die( "Couldn't gv $ps_file" ); + if ( defined $options{pdfview} ){ + system( "ps2pdf $ps_file $pdf_file;" ) + and die( "Couldn't ps2pdf $ps_file" ); + system( "$options{pdfview} $pdf_file" ) + and die( "Couldn't $options{pdfview} $pdf_file" ); + } else { + system( "gv $ps_file" ) and die( "Couldn't gv $ps_file" ); + } } } diff --git a/scigen.pm b/scigen.pm index 83073c1..2486cf9 100644 --- a/scigen.pm +++ b/scigen.pm @@ -176,29 +176,29 @@ sub pretty_print { $line =~ s/(\s+)([\.\,\?\;\:])/$2/g; $line =~ s/(\b)(a)\s+([aeiou])/$1$2n $3/gi; - if( $line =~ /\\section(\*?){(.*)}/ ) { + if( $line =~ /\\section(\*?)\{(.*)\}/ ) { $newline = "\\section${1}{" . Autoformat::autoformat( $2, { case => 'highlight', squeeze => 0 } ); chomp $newline; chomp $newline; $newline .= "}"; - } elsif( $line =~ /(\\subsection){(.*)}/ or - $line =~ /(\\slideheading){(.*)}/ ) { + } elsif( $line =~ /(\\subsection)\{(.*)\}/ or + $line =~ /(\\slideheading)\{(.*)\}/ ) { $newline = $1 . "{" . Autoformat::autoformat( $2, { case => 'highlight', squeeze => 0 } ); chomp $newline; chomp $newline; $newline .= "}"; - } elsif( $line =~ /\\title{(.*)}/ ) { + } elsif( $line =~ /\\title\{(.*)\}/ ) { $newline = "\\title{" . Autoformat::autoformat( $1, { case => 'highlight', squeeze => 0 } ); chomp $newline; chomp $newline; $newline .= "}"; - } elsif( $line =~ /(.*) = {(.*)}\,/ ) { + } elsif( $line =~ /(.*) = \{(.*)\}\,/ ) { my $label = $1; my $curr = $2; # place brackets around any words containing capital letters