--- loncom/xml/lonxml.pm 2002/07/29 22:06:38 1.186 +++ loncom/xml/lonxml.pm 2002/08/23 19:10:32 1.188 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # XML Parser Module # -# $Id: lonxml.pm,v 1.186 2002/07/29 22:06:38 www Exp $ +# $Id: lonxml.pm,v 1.188 2002/08/23 19:10:32 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -333,7 +333,8 @@ sub registerurl { my $target = shift; my $result = ''; if ($target eq 'edit') { - $result .="\n"; } @@ -538,6 +539,23 @@ sub htmlclean { return $output; } +sub latex_special_sumbols { + 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;} + if ($current_token=~m/[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { if ($metamode<1) { if ($target eq 'tex') { - my @temp_array = @$stack; - if ($temp_array[-1] ne 'm') { - if ($temp_array[-1] ne 'tt') { - if ($token->[1]=~m/\^/) {$token->[1]=~s/\^/\\verb|\^|/g;} - } else { - if ($token->[1]=~m/\^/) {$token->[1]=~s/\^/}\\verb|\^|{/g;} - } - if ($token->[1]=~m/>/) {$token->[1]=~s/>/\$>\$/g;} - if ($token->[1]=~m/[1]=~s/[1],$stack,$parstack); + } else { + $result.=$token->[1]; } - $result.=$token->[1]; } } elsif ($token->[0] eq 'PI') { if ($metamode<1) {