Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support for absolute value added

  • Loading branch information...
commit 5794f89813276b750277511bae759a1e9953f96b 1 parent 0c7aca9
fiedorow authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 filter/algebra/filter.php
View
4 filter/algebra/filter.php
@@ -3,7 +3,7 @@
// //
// NOTICE OF COPYRIGHT //
// //
-// Moodle - Filter for converting simple caclculator-type algebraic //
+// Moodle - Filter for converting simple calculator-type algebraic //
// expressions to cached gif images //
// //
// Copyright (C) 2004 Zbigniew Fiedorowicz fiedorow@math.ohio-state.edu //
@@ -171,6 +171,8 @@ function algebra_filter ($courseid, $text) {
$texexp = str_replace('\mbox{acsch}','\mbox{csch}^{-1}',$texexp);
$texexp = str_replace('\mbox{acoth}','\mbox{coth}^{-1}',$texexp);
$texexp = preg_replace('/\\\sqrt{(.+?),(.+?)}/s','\sqrt['. "\$2]{\$1}",$texexp);
+ $texexp = preg_replace('/\\\mbox{abs}\\\left\((.+?)\\\right\)/s',"|\$1|",$texexp);
+ $texexp = preg_replace('/\\\mbox{abs}\\\left\((.+?)\\\right\)/s',"|\$1|",$texexp);
$texexp = preg_replace('/\\\log\\\left\((.+?),(.+?)\\\right\)/s','\log_{'. "\$2}\\left(\$1\\right)",$texexp);
$texexp = preg_replace('/(\\\cos|\\\sin|\\\tan|\\\sec|\\\csc|\\\cot)([h]*)\\\left\((.+?),(.+?)\\\right\)/s',"\$1\$2^{". "\$4}\\left(\$3\\right)",$texexp);
$texexp = preg_replace('/\\\int\\\left\((.+?),(.+?),(.+?)\\\right\)/s','\int_'. "{\$2}^{\$3}\$1 ",$texexp);
Please sign in to comment.
Something went wrong with that request. Please try again.