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

albertel lon-capa-cvs@mail.lon-capa.org
Thu, 24 Feb 2005 05:33:55 -0000


albertel		Thu Feb 24 00:33:55 2005 EDT

  Modified files:              
    /loncom/xml	lontexconvert.pm 
  Log:
  - take care of some nic operators
  
  
Index: loncom/xml/lontexconvert.pm
diff -u loncom/xml/lontexconvert.pm:1.46 loncom/xml/lontexconvert.pm:1.47
--- loncom/xml/lontexconvert.pm:1.46	Thu Feb 24 00:26:00 2005
+++ loncom/xml/lontexconvert.pm	Thu Feb 24 00:33:55 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # TeX Conversion Module
 #
-# $Id: lontexconvert.pm,v 1.46 2005/02/24 05:26:00 albertel Exp $
+# $Id: lontexconvert.pm,v 1.47 2005/02/24 05:33:55 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -237,6 +237,11 @@
 sub prepare_algebra {
     my ($string)=@_;
 
+    # change some multi character operators into single character operators
+    $string =~ s/<>/\#/g;
+    $string =~ s/<\=/\%/g;
+    $string =~ s/>\=/\!/g;
+    
     #protect the confusable greek symbols
     $string =~ s/delta/zdelta/g;
     $string =~ s/beta/bita/g;
@@ -252,6 +257,11 @@
 sub postprocess_algebra {
     my ($string)=@_;
 
+    # exapnd out some operators
+    $string =~ s/\#/\\not= /g;
+    $string =~ s/\%/\\leq /g;
+    $string =~ s/\!/\\geq /g;
+
     # replace some special symbols with the LaTeX equivalents
     $string =~ s/infty/\\infty/g;
     $string =~ s/infinity/\\infty/g;