Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added --output option

darcs-hash:20070816205258-0f649-9f4ff6f2974e915a6313a55dad843d5eebe73a4f.gz
  • Loading branch information...
commit fee5a002afd38b28d785fd2615f65107ae6d1501 1 parent 06d710c
John MacFarlane authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. 9  sep-offprint
9  sep-offprint
@@ -2,6 +2,8 @@
2 2
 #
3 3
 # Version history:
4 4
 #
  5
+# sep-offprint 1.1 - John MacFarlane - August 16, 2007
  6
+#   + added --output|o option to specify output filename
5 7
 # sep-offprint 1.0 - John MacFarlane - July 19, 2007
6 8
 #   + include supplements in the ordered they are linked to
7 9
 #   + always put notes at the end
@@ -77,6 +79,7 @@ Options (* indicates a default):
77 79
 --2up                  print two pages per sheet, landscape orientation*
78 80
 --ps                   produce postscript (PS) output
79 81
 --pdf                  produce PDF output*
  82
+--output <filename>    name of output file (defaults to <entryname>.ps|pdf)
80 83
 --font <font>          use <font> (Times*, Helvetica, Palatino, Courier)
81 84
 --size <size>          use <size> (10pt, 12pt, 14pt*, 16pt)
82 85
 --align <align>        use <align> (left, justified*)
@@ -189,6 +192,7 @@ GetOptions( '1up|1' => \$oneup,
189 192
             '2up|2' => \$twoup,
190 193
             'ps' => \$ps,
191 194
             'pdf' => \$pdf,
  195
+            'output|o=s' => \$outfile,
192 196
             'font=s' => \$fontfamily,
193 197
             'size=s' => \$fontsize,
194 198
             'align=s' => \$textalign,
@@ -230,6 +234,7 @@ if ($help) {&printhelp;};
230 234
 if (not ($pdf or $ps)) {$pdf=1};
231 235
 if ($oneup) {$twoup = 0} else {$twoup = 1};
232 236
 if (not $fontsize) {$fontsize = "14pt"};
  237
+if (not $outfile) {$outfile = $entryname} else {$outfile =~ s/\.[^.]*$//};
233 238
 if (not $fontfamily) {$fontfamily = "Times"};
234 239
 if (not $textalign) {$textalign = "justify"};
235 240
 if (not $papersize) {$papersize = "letter"};
@@ -340,9 +345,9 @@ print STDERR "Creating offprint...\n";
340 345
 system("html2ps -D -U -f $html2psrc -o $pstemp index.html " . $orderedHtmlFiles . " $notes $blank");
341 346
 
342 347
 # create pdf if requested
343  
-if ($pdf) {system("ps2pdf -sPAPERSIZE=$papersize $pstemp $current/$entryname.pdf") || print "Created $entryname.pdf\n";};
  348
+if ($pdf) {system("ps2pdf -sPAPERSIZE=$papersize $pstemp $current/$outfile.pdf") || print "Created $outfile.pdf\n";};
344 349
 
345 350
 # copy ps file if requested
346  
-if ($ps) {copy($pstemp, "$current/$entryname.ps") && print "Created $entryname.ps\n";};
  351
+if ($ps) {copy($pstemp, "$current/$outfile.ps") && print "Created $outfile.ps\n";};
347 352
 
348 353
 # note: temporary directory will be deleted automatically on exit

0 notes on commit fee5a00

Please sign in to comment.
Something went wrong with that request. Please try again.