--- loncom/xml/londefdef.pm 2007/03/13 13:35:39 1.358 +++ loncom/xml/londefdef.pm 2007/03/13 15:05:19 1.360 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.358 2007/03/13 13:35:39 foxr Exp $ +# $Id: londefdef.pm,v 1.360 2007/03/13 15:05:19 foxr Exp $ # # # Copyright Michigan State University Board of Trustees @@ -128,6 +128,7 @@ sub start_m { #&Apache::lonxml::debug("M is ends with:$currentstring:"); $Apache::lonxml::post_evaluate=0; } elsif ($target eq 'tex') { + $currentstring = $inside; my $eval=&Apache::lonxml::get_param('eval',$parstack,$safeeval); if ($eval eq 'on') { @@ -135,11 +136,13 @@ sub start_m { } if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';} # detect simple math mode entry exits, and convert them - # to use \ensuremath - if ($currentstring=~/^\s*\$[^\$].*[^\$]\$\s*$/) { - $currentstring=~s/^(\s*)\$/$1/; - $currentstring=~s/\$(\s*)$/$1/; - $currentstring='\ensuremath{'.$currentstring.'}'; + # to use \ensuremath ... unless there's a \verb inside. + if (! ($currentstring=~/\\verb/)) { + if ($currentstring=~/^\s*\$[^\$].*[^\$]\$\s*$/) { + $currentstring=~s/^(\s*)\$/$1/; + $currentstring=~s/\$(\s*)$/$1/; + $currentstring='\ensuremath{'.$currentstring.'}'; + } } $Apache::lonxml::post_evaluate=0; } @@ -2220,15 +2223,7 @@ sub end_table { $Apache::londefdef::table[-1]{'content'}=\@cleaned_table; @fwidth=@cleaned_header; } - # At this time we must be sure the table does not overhang the total width - # this can happen due to our 'average width' adjustment. - # Total the column widths and see if they are larger than the avail width; - # If so scale them down in proportion to their percentage of total width. - - my $current_total_width = 0; - for (my $col = 0; $col < $#fwidth; $col++) { - $current_total_width = $current_total_width + $fwidth[$col]; - } + #construct header of the table my $header_of_table = '{'.$Apache::londefdef::table[-1]{'vvinc'};