[LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Thu, 25 Apr 2002 21:38:42 -0000


sakharuk		Thu Apr 25 17:38:42 2002 EDT

  Modified files:              
    /loncom/interface	lonprintout.pm 
  Log:
   changes to clean up tex output
  
  
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.22 loncom/interface/lonprintout.pm:1.23
--- loncom/interface/lonprintout.pm:1.22	Fri Apr 12 09:45:48 2002
+++ loncom/interface/lonprintout.pm	Thu Apr 25 17:38:42 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Printout
 #
-# $Id: lonprintout.pm,v 1.22 2002/04/12 13:45:48 sakharuk Exp $
+# $Id: lonprintout.pm,v 1.23 2002/04/25 21:38:42 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -223,12 +223,20 @@
 	$result =~ s/\\includegraphics/\\includegraphics\[width=9\.0 cm\]/g;
 	$result =~ s/(\\end{document})/\\newline\\noindent\\makebox\[9.0cm\]\[b\]{\\hrulefill}\\newline\\noindent\\tiny Dept\. of Physics and Astronomy, MSU\\makebox\[1.5cm\]\[b\]{\\hfill}LON-CAPA\\copyright MSU GNU\/GPS $1/;
     }
-#-- LaTeX corrections 
+#-- LaTeX corrections     
+    my $first_comment = index($result,'<!--',0);
+    while ($first_comment != -1) {
+	my $end_comment = index($result,'-->',$first_comment);
+	substr($result,$first_comment,$end_comment-$first_comment+3) = '';
+	$first_comment = index($result,'<!--',$first_comment);
+    }
     $result =~ s/^\s+$//gm; #remove empty lines
     $result =~ s/%/\\%/g;   #corrects %
     $result =~ s/(\s)+/$1/g; #removes more than one empty space
-    $result =~ s/\\\\\s*(\\vskip)/ $1/gm;
+    $result =~ s/\\\\\s*\\vskip/\\vskip/gm;
     $result =~ s/ (<|>|) / \$$1\$ /g; #corrects < or >
+    $result =~ s/\\\\\s*\\noindent\s*(\\\\)+/\\\\\\noindent/g;
+    $result =~ s/{\\par }\s*\\\\/\\\\/gm;
 #-- Do all of eps figures exist?
     my $needconvert = 0;
     $_ = $result;