--- loncom/xml/londefdef.pm 2002/11/18 20:47:51 1.105 +++ loncom/xml/londefdef.pm 2002/11/19 15:13:37 1.106 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.105 2002/11/18 20:47:51 sakharuk Exp $ +# $Id: londefdef.pm,v 1.106 2002/11/19 15:13:37 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -965,7 +965,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= '\underline{'; + &Apache::lonxml::startredirection(); } return $currentstring; } @@ -975,7 +975,10 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= '}'; + $currentstring=&Apache::lonxml::endredirection(); + $currentstring=~s/(\S)(\s+)(\S)/$1}$2\\underline{$3/g; + $currentstring=~s/^\s*(\S)/\\underline{$1/; + $currentstring=~s/(\S)\s*$/$1}/; } return $currentstring; } @@ -986,7 +989,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= '\underline{'; + &Apache::lonxml::startredirection(); } return $currentstring; } @@ -996,7 +999,10 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= '}'; + $currentstring=&Apache::lonxml::endredirection(); + $currentstring=~s/(\S)(\s+)(\S)/$1}$2\\underline{$3/g; + $currentstring=~s/^\s*(\S)/\\underline{$1/; + $currentstring=~s/(\S)\s*$/$1}/; } return $currentstring; } @@ -1142,7 +1148,7 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[4]; } elsif ($target eq 'tex') { - $currentstring .= '\underline{'; + &Apache::lonxml::startredirection(); } return $currentstring; } @@ -1152,7 +1158,10 @@ EDITBUTTON if ($target eq 'web') { $currentstring .= $token->[2]; } elsif ($target eq 'tex') { - $currentstring .= '}'; + $currentstring=&Apache::lonxml::endredirection(); + $currentstring=~s/(\S)(\s+)(\S)/$1}$2\\underline{$3/g; + $currentstring=~s/^\s*(\S)/\\underline{$1/; + $currentstring=~s/(\S)\s*$/$1}/; } return $currentstring; }