[LON-CAPA-cvs] cvs: doc /help render.texxml.pl

bowersj2 lon-capa-cvs@mail.lon-capa.org
Fri, 19 Jul 2002 14:27:05 -0000


bowersj2		Fri Jul 19 10:27:05 2002 EDT

  Modified files:              
    /doc/help	render.texxml.pl 
  Log:
  If the LaTeX run doesn't succeed, don't hang on it.
  
  
  
Index: doc/help/render.texxml.pl
diff -u doc/help/render.texxml.pl:1.2 doc/help/render.texxml.pl:1.3
--- doc/help/render.texxml.pl:1.2	Thu Jul 18 10:58:03 2002
+++ doc/help/render.texxml.pl	Fri Jul 19 10:27:05 2002
@@ -60,6 +60,8 @@
     $epssource = $ARGV[2];
 }
 
+my $redir = ">& /dev/null"; # empty this for easier debugging
+
 mkdir $tmpdir;
 
 print "Converting texxml to tex...\n";
@@ -68,16 +70,24 @@
 print "Copying .eps files...\n";
 system ( "cp $epssource/* $tmpdir/" );
 
+# \scrollmode\input causes LaTeX to not stop on errors
 print "Running Latex...\n";
-system ( "cd $tmpdir; latex $fileroot >& /dev/null; latex $fileroot >& /dev/null; latex $fileroot >& /dev/null; " );
+system ( "cd $tmpdir; latex \"\\scrollmode\\input $fileroot\" $redir; latex \"\\scrollmode\\input $fileroot\ $redir; latex \"\\scrollmode\\input $fileroot\ $redir; " );
 
 print "Running dvips...\n";
-system ( "cd $tmpdir; dvips -f $fileroot.dvi > $fileroot.ps >& /dev/null " );
+system ( "cd $tmpdir; dvips -f $fileroot.dvi > $fileroot.ps $redir " );
 
 print "Copying ps file...\n";
 system ( "cp $tmpdir/$fileroot.ps .");
 
 print "Clearing temp directory...\n";
-system ( "rm -rf $tmpdir" );
+#system ( "rm -rf $tmpdir" );
 
-print "$fileroot.ps is ready, if all went well.\n";
+if ( -e $fileroot . ".ps" )
+{
+    print "$fileroot.ps is ready.\n";
+}
+else
+{
+    print "Generationr of $fileroot.ps failed.\n";
+}