--- loncom/interface/lonprintout.pm 2002/07/22 20:04:16 1.40 +++ loncom/interface/lonprintout.pm 2002/07/25 18:58:09 1.42 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.40 2002/07/22 20:04:16 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.42 2002/07/25 18:58:09 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -292,11 +292,13 @@ ENDPART $result =~ s/{\\par }\s*\\\\/\\\\/gm; $result =~ s/\\\\\s+\[/ \[/g; $result =~ s/θ/\$\\theta\$/g; #converts theta from html into tex - $result =~ s/\b_+\b/\\makebox\[1 cm\]\[b\]{\\hrulefill}/g; + $result =~ s/\b__+\b/\\makebox\[1 cm\]\[b\]{\\hrulefill}/g; #conversion of html characters to LaTeX equivalents if ($result =~ m/&(\w+|#\d+);/) { $result = &character_chart($result); } + $result =~ s/(\\end{tabular})\s*\\vskip 0 mm/$1/g; + $result =~ s/(\\begin{enumerate})\s*\\noindent/$1/g; #-- writing .tex file in prtspool my $temp_file; my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout_".time."_".rand(10000000).".tex"; @@ -314,6 +316,7 @@ FINALEND sub character_chart { my $result = shift; + $result =~ s/�?0?7;//g; $result =~ s/�?0?9;//g; $result =~ s/�?10;//g; $result =~ s/�?13;//g; @@ -472,8 +475,8 @@ sub character_chart { # $result =~ s/®//g; # $result =~ s/¯//g; # $result =~ s/¯//g; - $result =~ s/°/\$^\\{\\circ\\}\$/g; - $result =~ s/°/\$^\\{\\circ\\}\$/g; + $result =~ s/°/\$^{\\circ}\$/g; + $result =~ s/°/\$^{\\circ}\$/g; $result =~ s/±/\$\\pm\$/g; $result =~ s/±/\$\\pm\$/g; $result =~ s/²/\$^2\$/g; @@ -635,6 +638,9 @@ sub character_chart { return $result; } + +#'"` + sub additional_cleanup { my $result = shift; my $first_app = index($result,'\documentclass',0);