version 1.271, 2003/08/13 14:23:37
|
version 1.273, 2003/08/21 15:51:41
|
Line 478 sub htmlclean {
|
Line 478 sub htmlclean {
|
} |
} |
|
|
sub latex_special_symbols { |
sub latex_special_symbols { |
my ($current_token,$stack,$parstack,$where)=@_; |
my ($string,$where)=@_; |
if ($where eq 'header') { |
if ($where eq 'header') { |
$current_token =~ s/(\\|_|\^)/ /g; |
$string =~ s/(\\|_|\^)/ /g; |
$current_token =~ s/(\$|%|\#|&|\{|\})/\\$1/g; |
$string =~ s/(\$|%|\#|&|\{|\})/\\$1/g; |
|
$string =~ s/_/ /g; |
} else { |
} else { |
$current_token=~s/\\ /\\char92 /g; |
$string=~s/\\ /\\char92 /g; |
$current_token=~s/\^/\\char94 /g; |
$string=~s/\^/\\char94 /g; |
$current_token=~s/\~/\\char126 /g; |
$string=~s/\~/\\char126 /g; |
$current_token=~s/(&[^A-Za-z\#])/\\$1/g; |
$string=~s/(&[^A-Za-z\#])/\\$1/g; |
$current_token=~s/([^&])\#/$1\\#/g; |
$string=~s/([^&])\#/$1\\#/g; |
$current_token=~s/(\$|_|{|})/\\$1/g; |
$string=~s/(\$|_|{|})/\\$1/g; |
$current_token=~s/\\char92 /\\texttt{\\char92}/g; |
$string=~s/\\char92 /\\texttt{\\char92}/g; |
$current_token=~s/(>|<)/\$$1\$/g; #more or less |
$string=~s/(>|<)/\$$1\$/g; #more or less |
if ($current_token=~m/\d%/) {$current_token =~ s/(\d)%/$1\\%/g;} #percent after digit |
if ($string=~m/\d%/) {$string =~ s/(\d)%/$1\\%/g;} #percent after digit |
if ($current_token=~m/\s%/) {$current_token =~ s/(\s)%/$1\\%/g;} #persent after space |
if ($string=~m/\s%/) {$string =~ s/(\s)%/$1\\%/g;} #percent after space |
if ($current_token eq '%.') {$current_token = '\%.';} #persent at the end of statement |
if ($string eq '%.') {$string = '\%.';} #percent at the end of statement |
} |
} |
return $current_token; |
return $string; |
} |
} |
|
|
sub inner_xmlparse { |
sub inner_xmlparse { |
Line 585 sub inner_xmlparse {
|
Line 586 sub inner_xmlparse {
|
if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { |
if (($token->[0] eq 'T') || ($token->[0] eq 'C') || ($token->[0] eq 'D') ) { |
#Style file definitions should be correct |
#Style file definitions should be correct |
if ($target eq 'tex' && ($Apache::lonxml::usestyle)) { |
if ($target eq 'tex' && ($Apache::lonxml::usestyle)) { |
$result=&latex_special_symbols($result,$stack,$parstack); |
$result=&latex_special_symbols($result); |
} |
} |
} |
} |
|
|