--- loncom/xml/londefdef.pm 2006/01/09 22:53:25 1.311 +++ loncom/xml/londefdef.pm 2006/01/12 23:48:00 1.313 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.311 2006/01/09 22:53:25 albertel Exp $ +# $Id: londefdef.pm,v 1.313 2006/01/12 23:48:00 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1187,6 +1187,7 @@ sub start_p { $closing_string = '

'; # Deal correctly with

e.g. } } elsif ($target eq 'tex' && !$para_disabled) { + $currentstring .= &end_p(); # close off prior para if in progress. my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1); if ($align eq 'center') { @@ -1204,7 +1205,11 @@ sub start_p { $closing_string = '}\hfill}'; } else { $currentstring.='\par '; - $closing_string = '\strut\\\\\strut '; + if (&is_inside_of($tagstack, 'table')) { + $closing_string = '\vskip 12pt'; # Safer in tables. + } else { + $closing_string = '\strut\\\\\strut '; + } } } @@ -2765,12 +2770,7 @@ sub start_img { $safeeval, undef,1)); if(!$align) { - # disabled for now see BUG#4535 - if (0 && &is_inside_of($tagstack, "table")) { - $align = "right"; # Force wraptext use. - } else { $align = "bottom"; # This is html's default so it's ours too. - } } # &Apache::lonxml::debug("Alignemnt = $align"); @@ -2785,11 +2785,17 @@ sub start_img { $parstack, $safeeval, undef,0); - &Apache::lonxml::debug("LaTeX rendering = $latex_rendering"); + # &Apache::lonxml::debug("LaTeX rendering = $latex_rendering"); if(!$latex_rendering) { - $latex_rendering = "texwrap"; + $latex_rendering = "texwrap"; + } + # using texwrap inside a table does not work. So, if after all of this, + # texwrap is on, we turn it off if we detect we're in a table: + # + if (($latex_rendering eq 'texwrap') && &is_inside_of($tagstack, "table")) { + $latex_rendering = 'parpic'; } - &Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src"); + # &Apache::lonxml::debug("LaTeX rendering = $latex_rendering image file: $src"); #if original gif/jpg/png file exist do following: my $origsrc=$src;