--- loncom/xml/londefdef.pm 2004/07/12 16:11:30 1.225 +++ loncom/xml/londefdef.pm 2004/07/12 17:57:36 1.227 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.225 2004/07/12 16:11:30 sakharuk Exp $ +# $Id: londefdef.pm,v 1.227 2004/07/12 17:57:36 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -1133,15 +1133,13 @@ sub end_p { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - if ($$tagstack[-1] eq 'p') { - my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1); - if ($align eq 'center') { - $currentstring .= '\end{center}'; - } elsif ($align eq 'right') { - $currentstring .= '}}'; - } elsif ($align eq 'left') { - $currentstring .= '}\hfill}'; - } + my $align=&Apache::lonxml::get_param('align',$parstack,$safeeval,undef,1); + if ($align eq 'center') { + $currentstring .= '\end{center}'; + } elsif ($align eq 'right') { + $currentstring .= '}}'; + } elsif ($align eq 'left') { + $currentstring .= '}\hfill}'; } } return $currentstring; @@ -1154,8 +1152,16 @@ sub start_br { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - if (($$tagstack[-2] eq 'b') || ($$tagstack[-2] eq 'strong') || - ($$tagstack[-2] eq 'ol') || ($$tagstack[-2] eq 'ul')) { + my @tempo=@$tagstack; + my $sygnal=0; + for (my $i=$#tempo;$i>=0;$i--) { + if (($tempo[$i] eq 'b') || ($tempo[$i] eq 'strong') || + ($tempo[$i] eq 'ol') || ($tempo[$i] eq 'ul')) { + $sygnal=1; + last; + } + } + if ($sygnal) { $currentstring .= ' \vskip 0 mm '; } elsif ($$tagstack[-2] ne 'sub' && $$tagstack[-2] ne 'sup') { $currentstring .= '\strut \\\\ \strut ';