--- loncom/xml/londefdef.pm 2002/07/11 19:32:06 1.71 +++ loncom/xml/londefdef.pm 2002/07/23 19:15:08 1.75 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.71 2002/07/11 19:32:06 sakharuk Exp $ +# $Id: londefdef.pm,v 1.75 2002/07/23 19:15:08 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -74,7 +74,7 @@ sub start_m { my $currentstring = ''; if ($target eq 'web') { $Apache::lonxml::prevent_entity_encode++; - my $inside = &Apache::lonxml::get_all_text("/m",$$parser[-1]); + my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); $inside ='\\documentstyle{article}'.$inside; &Apache::lonxml::debug("M is starting with:$inside:"); my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); @@ -90,7 +90,9 @@ sub start_m { } #&Apache::lonxml::debug("M is ends with:$currentstring:"); } elsif ($target eq 'tex') { - $currentstring = ""; + $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); + } else { + my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); } return $currentstring; } @@ -835,12 +837,15 @@ EDITBUTTON } #--
tag sub start_br { - my ($target,$token) = @_; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $currentstring = ''; if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= '\vskip 0 mm'; + my @temp = @$tagstack; + if ($temp[-2] ne 'sub' && $temp[-2] ne 'sup') { + $currentstring .= '\vskip 0 mm'; + } } elsif ($target eq 'latexsource') { $currentstring .= '\\'; } @@ -1033,7 +1038,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\\hline "; + $currentstring .= '\vskip 0 mm \noindent\makebox[\textwidth - 8 mm][b]{\hrulefill}'; } return $currentstring; } @@ -1424,7 +1429,10 @@ EDITBUTTON } elsif ($target eq 'tex') { my $current_row = $Apache::londefdef::table[-1]{'row_number'}; my $data=&Apache::lonxml::endredirection(); - @{ $Apache::londefdef::table[-1]{'rowdata'} }[$current_row] .= '\bf{'.$data.'} '.$Apache::londefdef::table[-1]{'vinc'}; + if ($data=~m/width\s*=\s*(\d+\.*\d*\s*(mm|cm))/) { #just added + $Apache::londefdef::table[-1]{'length'} .= $1.','; #just added + } #just added + @{ $Apache::londefdef::table[-1]{'rowdata'} }[$current_row] .= '\parbox{'.$1.'}{\textbf{'.$data.'}} '.$Apache::londefdef::table[-1]{'vinc'}; } return $currentstring; }