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";