From 25d7779cf2b89e4e4fdf79f1964a2f5ee580ffc9 Mon Sep 17 00:00:00 2001 From: thepurpleblob Date: Fri, 22 Jul 2005 09:01:34 +0000 Subject: [PATCH] Added additional features/fixes noted in bug #3795 by Dmitry Pupinin. --- filter/tex/filter.php | 8 +++++--- filter/tex/pix.php | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/filter/tex/filter.php b/filter/tex/filter.php index 78f74192a14..591b5c2d86f 100644 --- a/filter/tex/filter.php +++ b/filter/tex/filter.php @@ -88,7 +88,7 @@ function tex_filter ($courseid, $text) { global $CFG; /// Do a quick check using stripos to avoid unnecessary work - if (!preg_match('/ TeX expression // or $$ TeX expression $$ - preg_match_all('/(.+?)<\/tex>|\$\$(.+?)\$\$/is', $text, $matches); + // or \[ TeX expression \] // original tag of MathType and TeXaide (dlnsk) + preg_match_all('/(.+?)<\/tex>|\$\$(.+?)\$\$|\\\\\[(.+?)\\\\\]/is', $text, $matches); for ($i=0; $i','',$texexp); $texexp = str_replace('','',$texexp); $texexp = str_replace('','',$texexp); $texexp = str_replace('','',$texexp); + $texexp = eregi_replace("", '', $texexp); //dlnsk $align = "middle"; if (preg_match('/^align=bottom /',$texexp)) { $align = "text-bottom"; diff --git a/filter/tex/pix.php b/filter/tex/pix.php index 7faaa73645e..f7e777213c2 100644 --- a/filter/tex/pix.php +++ b/filter/tex/pix.php @@ -71,6 +71,10 @@ $cmd = "\"$CFG->dirroot/$CFG->texfilterdir/mimetex.darwin\" -e \"$pathname\" -- ". escapeshellarg($texexp); break; + case "FreeBSD": + $cmd = "\"$CFG->dirroot/$CFG->texfilterdir/mimetex.freebsd\" -e \"$pathname\" ". escapeshellarg($texexp); + break; + default: /// Nothing was found, so tell them how to fix it. if ($CFG->debug > 7) { echo "Make sure you have an appropriate MimeTeX binary here:\n\n";