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

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 28 Aug 2003 13:58:35 -0000


sakharuk		Thu Aug 28 09:58:35 2003 EDT

  Modified files:              
    /loncom/interface	printout.pl 
  Log:
  You have links to log and original LaTeX files even in the case of nonbatch mode processing. I'll do some clening of this script a little bit later (continue toplay with it for some particular cases).
  
  
Index: loncom/interface/printout.pl
diff -u loncom/interface/printout.pl:1.34 loncom/interface/printout.pl:1.35
--- loncom/interface/printout.pl:1.34	Thu Aug 28 09:52:22 2003
+++ loncom/interface/printout.pl	Thu Aug 28 09:58:35 2003
@@ -88,6 +88,24 @@
 		  print "$content_of_file[$i]<br />";
 	      }  
 	  } 
+              print "<b><big>The link to ";
+              $logfilename=~s/\/home\/httpd//;
+	      print "<a href=\"$logfilename\">Your log file </a></big></b>";
+	      print "\n";
+              #link tooriginal LaTeX file (included according Michael Hamlin desire)
+	      my $tex_temporary_file=IO::File->new($texfile) || die "Couldn't open file for reading: $!\n";
+	      my @tex_content_of_file = <$tex_temporary_file>;
+	      close $tex_temporary_file; 
+	      my $body_tex_file = join(' ',@tex_content_of_file);
+	      $texfile =~ s/\.tex$/aaaaa\.html/;
+	      $tex_temporary_file = IO::File->new('>'.$texfile); 
+	      print $tex_temporary_file '<html><head><title>LOGFILE</title></head><body><pre>'.$body_tex_file.'</pre></body></html>'."\n";
+	      print "<br /><br />";
+	      print "<b><big>The link to ";
+	      $texfile=~s/\/home\/httpd//;
+	      print "<a href=\"$texfile\">Your original LaTeX file </a></big></b>";
+	      print "\n";
+
       } elsif ($body_log_file=~m/<inserted text>/) {
 	  my $whereitbegins = index $body_log_file,'<inserted text>';
 	  print "You are running LaTeX in the <b>batch mode</b>.";