[LON-CAPA-cvs] cvs: loncom /interface printout.pl

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 14 Aug 2002 20:38:52 -0000


sakharuk		Wed Aug 14 16:38:52 2002 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  Prints in two columns in portrait environment.
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.17 loncom/interface/printout.pl:1.18
--- loncom/interface/printout.pl:1.17	Wed Aug 14 15:33:14 2002
+++ loncom/interface/printout.pl	Wed Aug 14 16:38:52 2002
@@ -3,7 +3,7 @@
 use Image::Magick;
  print "Content-type: text/html\n\n";
  print "<body bgcolor=\"#FFFFFF\">\n";
-  my ($texfile,$laystyle) = split(/&/,$ENV{'QUERY_STRING'});
+  my ($texfile,$laystyle,$numberofcolumns) = split(/&/,$ENV{'QUERY_STRING'});
   my $figfile = $texfile;
   $figfile =~ s/^([^\.]+printout)[^t]+\.tex/$1\.dat/;
   my $duefile = $texfile;
@@ -79,7 +79,11 @@
 	      $comma = "psnup -2 -s1.0 $new_name_file";
 	      system("$comma $tempo_file"); 
 	      system("ps2pdf $tempo_file $name_file");
-	  } elsif ($laystyle eq 'book') {
+	  } elsif ($laystyle eq 'book' and $numberofcolumns eq '2') {
+	      $comma = 'pstops "2:0+1(0.5w,0)"';
+	      system("$comma $new_name_file $tempo_file");
+	      system("ps2pdf $tempo_file $name_file");
+	  } else {
 	      system("ps2pdf $new_name_file $name_file");
 	  }	    
 	  my $texlog = $texfile;
@@ -91,7 +95,7 @@
 	  $texdvi =~ s/\.tex/\.dvi/;
 	  $texps =~ s/\.tex/\.ps/;
 	  my @garb = ($texlog,$texaux,$texdvi,$texps);
-	  unlink @garb;
+	  #unlink @garb;
 	  unlink $duefile;
 	  print "<a href=\"/prtspool/$name_file\">Your PDF document</a>";
 	  print "\n";