Now strips outermost parentheses in denominators

This commit is contained in:
fiedorow 2004-02-19 21:27:16 +00:00
parent d956341c66
commit 65a275f404
2 changed files with 2 additions and 0 deletions

View File

@ -107,6 +107,7 @@ function refineTeX($texexp) {
$texexp = str_replace('\mbox{asech}','\mbox{sech}^{-1}',$texexp);
$texexp = str_replace('\mbox{acsch}','\mbox{csch}^{-1}',$texexp);
$texexp = str_replace('\mbox{acoth}','\mbox{coth}^{-1}',$texexp);
$texexp = preg_replace('/\\\frac{(.+?)}{\\\left\((.+?)\\\right\)}/s','\frac{'."\$1}{\$2}",$texexp);
$texexp = preg_replace('/\\\sqrt{(.+?),(.+?)}/s','\sqrt['. "\$2]{\$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);

View File

@ -170,6 +170,7 @@ function algebra_filter ($courseid, $text) {
$texexp = str_replace('\mbox{asech}','\mbox{sech}^{-1}',$texexp);
$texexp = str_replace('\mbox{acsch}','\mbox{csch}^{-1}',$texexp);
$texexp = str_replace('\mbox{acoth}','\mbox{coth}^{-1}',$texexp);
$texexp = preg_replace('/\\\frac{(.+?)}{\\\left\((.+?)\\\right\)}/s','\frac{'."\$1}{\$2}",$texexp);
$texexp = preg_replace('/\\\sqrt{(.+?),(.+?)}/s','\sqrt['. "\$2]{\$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);