--- loncom/xml/londefdef.pm 2003/10/14 14:40:33 1.181 +++ loncom/xml/londefdef.pm 2003/10/20 19:47:23 1.183 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.181 2003/10/14 14:40:33 sakharuk Exp $ +# $Id: londefdef.pm,v 1.183 2003/10/20 19:47:23 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -625,8 +625,7 @@ sub start_strong { sub end_strong { my ($target,$token) = @_; my $currentstring = ''; - if ($target eq 'web') { - + if ($target eq 'web') { $currentstring = $token->[2]; } elsif ($target eq 'tex') { $currentstring = '}'; @@ -1323,7 +1322,7 @@ sub start_sub { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\$_{ "; + $currentstring .= "\$_{"; } return $currentstring; } @@ -1334,7 +1333,7 @@ sub end_sub { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= " }\$"; + $currentstring .= "}\$"; } return $currentstring; } @@ -1346,7 +1345,7 @@ sub start_sup { if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= "\$^{ "; + $currentstring .= "\$^{"; } return $currentstring; } @@ -1357,7 +1356,7 @@ sub end_sup { if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= " }\$"; + $currentstring .= "}\$"; } return $currentstring; } @@ -1998,11 +1997,15 @@ sub end_td_tex { $elementdata=~s/^\s+(\S.*)/$1/; $elementdata=~s/(.*\S)\s+$/$1/; $elementdata=~s/(\s)+/$1/; + my $lengthnewdata=1.8*length($elementdata); if ($lengthnewdata>$current_length) {$current_length=$lengthnewdata;} } } else { - $current_length=1.8*length($data); + my $working_data=$data; + $working_data=~s/(\$\_\{|\$\_|\$\^{|\$\^|\}\$|\$)//g; + $working_data=~s/\\cdot/ /; + $current_length=1.8*length($working_data); } $Apache::londefdef::table[-1]{'length'} .= $current_length.','; $Apache::londefdef::table[-1]{'TeXlength'} .= '0,'; @@ -2163,7 +2166,9 @@ sub start_img { my $filename = "/home/httpd/prtspool/$ENV{'user.name'}_$ENV{'user.domain'}_printout.dat"; $temp_file = Apache::File->new('>>'.$filename); print $temp_file "$src\n"; - $currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool/}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; + $newsrc=~s/\/home\/httpd\/html\/res//; + $newsrc=~s/\/([^\/]+)\.(ps|eps)/\//; + $currentstring .= '\vskip 1 mm \graphicspath{{/home/httpd/prtspool'.$newsrc.'}}\includegraphics[width='.$width_param.' mm]{'.$file.'} '; } } } else {