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

raeburn lon-capa-cvs-allow@mail.lon-capa.org
Mon, 27 Oct 2008 19:15:36 -0000


raeburn		Mon Oct 27 19:15:36 2008 EDT

  Modified files:              
    /loncom/xml	londefdef.pm lonxml.pm 
  Log:
  Subsitution of $m in expressions such as <m>$m$</m>
  (inside <translated> block) which resulted in LaTeX errors when generating printouts.
   - update to previous fix (with lonxml.pm rev. 1.487).
   - preferred solution: issue was restricted to perl variables named with a single character (e.g., $m, $a, $L etc.).
     - modify regexp in londefdef.pm to detect these inside<m> tags. Revert lonxml.pm to 1.486.
  
  
Index: loncom/xml/londefdef.pm
diff -u loncom/xml/londefdef.pm:1.394 loncom/xml/londefdef.pm:1.395
--- loncom/xml/londefdef.pm:1.394	Wed Oct 15 09:25:42 2008
+++ loncom/xml/londefdef.pm	Mon Oct 27 19:15:35 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Tags Default Definition Module 
 #
-# $Id: londefdef.pm,v 1.394 2008/10/15 09:25:42 bisitz Exp $
+# $Id: londefdef.pm,v 1.395 2008/10/27 19:15:35 raeburn Exp $
 # 
 #
 # Copyright Michigan State University Board of Trustees
@@ -139,7 +139,7 @@
 	# detect simple math mode entry exits, and convert them
         # to use \ensuremath ... unless there's a \verb inside.
 	if (! ($currentstring=~/\\verb/)) {
-	    if ($currentstring=~/^\s*\$[^\$].*[^\$]\$\s*$/) {
+	    if ($currentstring=~/^\s*\$[^\$].*\$\s*$/) {
 		$currentstring=~s/^(\s*)\$/$1/;
 		$currentstring=~s/\$(\s*)$/$1/;
 		$currentstring='\ensuremath{'.$currentstring.'}';
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.487 loncom/xml/lonxml.pm:1.488
--- loncom/xml/lonxml.pm:1.487	Fri Oct 24 18:23:22 2008
+++ loncom/xml/lonxml.pm	Mon Oct 27 19:15:35 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.487 2008/10/24 18:23:22 raeburn Exp $
+# $Id: lonxml.pm,v 1.488 2008/10/27 19:15:35 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -505,12 +505,10 @@
 	  if (!$Apache::lonxml::usestyle) {
 	      $extras=$Apache::lonxml::style_values;
 	  }
-          if ($token->[1] ne 'translated') {
-	      if ( $#$parstack > -1 ) {
-	          $result=&Apache::run::evaluate($result,$safeeval,$extras.$$parstack[-1]);
-	      } else {
-	          $result= &Apache::run::evaluate($result,$safeeval,$extras);
-	      }
+	  if ( $#$parstack > -1 ) {
+	      $result=&Apache::run::evaluate($result,$safeeval,$extras.$$parstack[-1]);
+	  } else {
+	      $result= &Apache::run::evaluate($result,$safeeval,$extras);
           }
       }
       $Apache::lonxml::post_evaluate=1;