[LON-CAPA-cvs] cvs: loncom /homework/math_parser ENode.pm

damieng damieng at source.lon-capa.org
Thu Jan 19 14:24:57 EST 2017


damieng		Thu Jan 19 19:24:57 2017 EDT

  Modified files:              
    /loncom/homework/math_parser	ENode.pm 
  Log:
  limit: better consistency with Javascript math parser
  
Index: loncom/homework/math_parser/ENode.pm
diff -u loncom/homework/math_parser/ENode.pm:1.3 loncom/homework/math_parser/ENode.pm:1.4
--- loncom/homework/math_parser/ENode.pm:1.3	Tue Jun 30 17:42:14 2015
+++ loncom/homework/math_parser/ENode.pm	Thu Jan 19 19:24:57 2017
@@ -836,9 +836,14 @@
                         return "\\lim_{".$c2->toTeX()." \\to ".$c3->toTeX().
                         "}".$c1->toTeX();
                     } else {
-                        return "\\lim_{".$c2->toTeX()." \\to ".$c3->toTeX().
-                        (($c4->value eq "plus") ? "+" : "-").
-                        "}".$c1->toTeX();
+                        my $s = "\\lim_{".$c2->toTeX()." \\to ".$c3->toTeX();
+                        if ($c4->value eq "plus") {
+                            $s .= "+";
+                        } elsif ($c4->value eq "minus") {
+                            $s .= "-";
+                        }
+                        $s .= "}".$c1->toTeX();
+                        return $s;
                     }
                 }
                 when ("binomial") {




More information about the LON-CAPA-cvs mailing list