[LON-CAPA-cvs] cvs: loncom /xml lonxml.pm

sakharuk lon-capa-cvs@mail.lon-capa.org
Wed, 12 Feb 2003 20:43:18 -0000


sakharuk		Wed Feb 12 15:43:18 2003 EDT

  Modified files:              
    /loncom/xml	lonxml.pm 
  Log:
  Small changes to remove additional latex cleanup subroutine from lonprintout.pm.
  
  
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.228 loncom/xml/lonxml.pm:1.229
--- loncom/xml/lonxml.pm:1.228	Fri Feb  7 16:55:57 2003
+++ loncom/xml/lonxml.pm	Wed Feb 12 15:43:18 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.228 2003/02/07 21:55:57 albertel Exp $
+# $Id: lonxml.pm,v 1.229 2003/02/12 20:43:18 sakharuk Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -145,7 +145,7 @@
 $Apache::lonxml::request='';
 
 # a problem number counter, and check on ether it is used
-$Apache::lonxml::counter=1;
+$Apache::lonxml::counter=4;
 $Apache::lonxml::counter_changed=0;
 
 #internal check on whether to look at style defs
@@ -668,18 +668,24 @@
 }
 
 sub latex_special_symbols {
-    my ($current_token,$stack,$parstack)=@_;
-    $current_token=~s/\\ /\\char92 /g;
-    $current_token=~s/\^/\\char94 /g;
-    $current_token=~s/\~/\\char126 /g;
-    $current_token=~s/(&[^a-z\#])/\\$1/g;
-    $current_token=~s/([^&])\#/$1\\#/g;
-    $current_token=~s/(\$|_|{|})/\\$1/g;
-    $current_token=~s/\\char92 /\\texttt{\\char92}/g;
-    $current_token=~s/>/\$>\$/g; #more
-    $current_token=~s/</\$<\$/g; #less
-    if ($current_token=~m/\d%/) {$current_token =~ s/(\d)%/$1\\%/g;} #percent after digit
-    if ($current_token=~m/\s%/) {$current_token =~ s/(\s)%/$1\\%/g;} #persent after space
+    my ($current_token,$stack,$parstack,$where)=@_;
+    if ($where=='header') {
+      $current_token =~ s/_/ /g;
+      $current_token =~ s/\^/ /g;
+      $current_token =~ s/&/\\&/g;
+    } else {
+     $current_token=~s/\\ /\\char92 /g;
+     $current_token=~s/\^/\\char94 /g;
+     $current_token=~s/\~/\\char126 /g;
+     $current_token=~s/(&[^a-z\#])/\\$1/g;
+     $current_token=~s/([^&])\#/$1\\#/g;
+     $current_token=~s/(\$|_|{|})/\\$1/g;
+     $current_token=~s/\\char92 /\\texttt{\\char92}/g;
+     $current_token=~s/>/\$>\$/g; #more
+     $current_token=~s/</\$<\$/g; #less
+     if ($current_token=~m/\d%/) {$current_token =~ s/(\d)%/$1\\%/g;} #percent after digit
+     if ($current_token=~m/\s%/) {$current_token =~ s/(\s)%/$1\\%/g;} #persent after space
+    }
     return $current_token;
 }