diff options
Diffstat (limited to 'displayformula.php')
-rw-r--r-- | displayformula.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/displayformula.php b/displayformula.php index 9693af3..6ba12fb 100644 --- a/displayformula.php +++ b/displayformula.php @@ -48,11 +48,22 @@ try { $texexp = ''; } else { $exp = $p->parse($m[2], $vars); - if ($CFG->qtype_algebra_texdelimiters == 'old') { - $texexp = '$$'.$exp->tex().'$$'; - } else { - $texexp = '\['.$exp->tex().'\]'; + $texexp = $exp->tex(); + switch($CFG->qtype_algebra_texdelimiters) { + case 'old': + $texexp = '$$' . $texexp . '$$'; + break; + case 'new': + $texexp = '\\[' . $texexp . '\\]'; + break; + case 'simple'; + $texexp = '$' . $texexp . '$'; + break; + case 'inline': + $texexp = '\\(' . $texexp . '\\)'; + break; } + } } catch (Exception $e) { $validanswer = false; |