--- rat/lonpage.pm 2002/08/12 18:21:42 1.44 +++ rat/lonpage.pm 2003/02/03 18:03:53 1.48 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Page Handler # -# $Id: lonpage.pm,v 1.44 2002/08/12 18:21:42 albertel Exp $ +# $Id: lonpage.pm,v 1.48 2003/02/03 18:03:53 harris41 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,7 +33,6 @@ # 10/02,10/10,10/14,10/16,10/18,10/19,10/31,11/6,11/14,11/16, # YEAR=2001 # 08/13/01,08/30,10/1 Gerd Kortemeyer -# 12/16 Scott Harrison # YEAR=2002 # 03/19 Gerd Kortemeyer # @@ -171,14 +170,7 @@ sub handler { @rows=(); - &tracetable(0,$firstres,'&'.$lastres.'&'); - if ($hash{'src_'.$lastres}) { - my $brepriv= - &Apache::lonnet::allowed('bre',$hash{'src_'.$lastres}); - if (($brepriv eq '2') || ($brepriv eq 'F')) { - $rows[$#rows+1]=''.$lastres; - } - } + &tracetable(0,$firstres,'&'); # ------------------------------------------------------------ Add to symb list @@ -246,6 +238,13 @@ sub handler { } } my $output=Apache::lonnet::ssi($src,%posthash); + if ($target eq 'tex') { + $output =~ s/^([^&]+)\\begin{document}//; + $output =~ s/\\end{document}//; + $output = '\parbox{\minipagewidth}{ '.$output.' }'; + #some additional cleanup necessary for LateX (due to limitations of table environment + $output =~ s/(\\vskip\s*\d+mm)\s*(\\\\)+/$1/g; + } my $parser=HTML::TokeParser->new(\$output); my $token; my $thisdir=$src; @@ -368,7 +367,7 @@ sub handler { $requrl.'">'); } } else { - $r->print('\documentclass[letterpaper]{article} + $r->print('\documentclass{article} \newcommand{\keephidden}[1]{} \usepackage[dvips]{graphicx} \usepackage{epsfig} @@ -486,7 +485,7 @@ sub handler { unless ($target eq 'tex') { $r->print("\n"); } else { - $r->print('\end{longtable}'); + $r->print('\end{longtable}\strut'); } # ---------------------------------------------------------------- Submit, etc. if ($nforms) {