--- loncom/xml/lonxml.pm 2002/09/04 03:57:18 1.190 +++ loncom/xml/lonxml.pm 2002/09/04 21:01:33 1.193 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.190 2002/09/04 03:57:18 albertel Exp $ +# $Id: lonxml.pm,v 1.193 2002/09/04 21:01:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -539,21 +539,19 @@ sub htmlclean { return $output; } -sub latex_special_sumbols { +sub latex_special_symbols { my ($current_token,$stack,$parstack)=@_; - my @temp_array = @$stack; - if ($temp_array[-1] ne 'tt') { - if ($current_token=~m/\^/) {$current_token=~s/\^/\\verb|\^|/g;} - } else { - if ($current_token=~m/\^/) {$current_token=~s/\^/}\\verb|\^|{/g;} - } - if ($current_token=~m/>/) {$current_token=~s/>/\$>\$/g;} #more - if ($current_token=~m//\$>\$/g; #more + $current_token=~s/[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { if ($metamode<1) { my $text=$token->[1]; - if ($token->[0] eq 'C') { + if ($token->[0] eq 'C' && $target eq 'tex') { $text = '%'.$text; $text =~ s/[\n\r]//g; } @@ -636,7 +634,7 @@ sub inner_xmlparse { } if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { if ($target eq 'tex') { - $result=&latex_special_sumbols($result,$stack,$parstack); + $result=&latex_special_symbols($result,$stack,$parstack); } }