--- loncom/xml/londefdef.pm 2006/01/04 23:15:52 1.302.2.1 +++ loncom/xml/londefdef.pm 2006/01/13 21:05:57 1.302.2.3 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.302.2.1 2006/01/04 23:15:52 albertel Exp $ +# $Id: londefdef.pm,v 1.302.2.3 2006/01/13 21:05:57 albertel Exp $ # # # Copyright Michigan State University Board of Trustees @@ -620,7 +620,7 @@ sub end_center { } elsif ($target eq 'tex') { $currentstring = '\end{center}'; if (&is_inside_of($tagstack, "table")) { - $currentstring .= ¢er_correction(); + #$currentstring .= ¢er_correction(); } } return $currentstring; @@ -1194,7 +1194,7 @@ sub start_p { $closing_string = '\end{center}'; if (&is_inside_of($tagstack, "table")) { $currentstring = ¢er_correction().$currentstring; - $closing_string .= ¢er_correction(); + #$closing_string .= ¢er_correction(); } } elsif ($align eq 'right') { $currentstring.='\makebox['.$env{'form.textwidth'}.']{\hfill\llap{'; @@ -1539,7 +1539,7 @@ sub start_div { $endstring = '\end{center}'; if (&is_inside_of($tagstack, "table")) { $currentstring = ¢er_correction().$currentstring; - $endstring .= ¢er_correction(); + #$endstring .= ¢er_correction(); } } elsif ($align eq 'right') { @@ -1961,11 +1961,16 @@ sub start_table { # width either comes forced from the TeXwidth or the width parameters. # in either case it can be a percentage or absolute width. - + # in the width case we ignore absolute width my $TeXwidth = &Apache::lonxml::get_param('TeXwidth',$parstack,$safeeval,undef,0); if (!defined($TeXwidth)) { - $TeXwidth = &Apache::lonxml::get_param('width',$parstack,$safeeval,undef,1); - if (!defined($TeXwidth)) { $TeXwidth = $textwidth; } + my $htmlwidth = &Apache::lonxml::get_param('width',$parstack, + $safeeval,undef,1); + if ($htmlwidth =~ /%/) { + $TeXwidth = $htmlwidth; + } else { + $TeXwidth = $textwidth; + } } else { $Apache::londefdef::table[-1]{'forcedtablewidth'} = 1; } @@ -2211,7 +2216,7 @@ sub end_table { } $output.=$Apache::londefdef::table[-1]{'content'}[$in][$jn]; if ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'c') { - $output.='\end{center}'.¢er_correction(); + $output.='\end{center}';#.¢er_correction(); } elsif ($Apache::londefdef::table[-1]{'align'}[$in][$jn] eq 'r') { $output.='} '; } @@ -2649,8 +2654,8 @@ sub start_img { undef,1)); if(!$align) { # disabled for now see BUG#4535 - if (0 && &is_inside_of($tagstack, "table")) { - $align = "right"; # Force wraptext use. + if (&is_inside_of($tagstack, "table")) { + $align = "top"; # Force top of image to top of table cell } else { $align = "bottom"; # This is html's default so it's ours too. }