aboutsummaryrefslogtreecommitdiff
path: root/displayformula.php
diff options
context:
space:
mode:
authorJean-Michel Vedrine <vedrine@vedrine.org>2016-01-24 13:18:38 +0100
committerJean-Michel Vedrine <vedrine@vedrine.org>2016-01-24 13:20:41 +0100
commite0abd45dc194f7ede2b460c6e9c2c303d4321bd7 (patch)
treeca54f942ddac9c4cce62db73a8ee90c074331590 /displayformula.php
parentab2016462cb7204f8e5e7fb6e5b9bdf1f4db68c6 (diff)
Solve display using MathJax for all websites
Diffstat (limited to 'displayformula.php')
-rw-r--r--displayformula.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/displayformula.php b/displayformula.php
index 788304b..58723f1 100644
--- a/displayformula.php
+++ b/displayformula.php
@@ -62,8 +62,15 @@ $text = format_text($texexp, FORMAT_MOODLE, $formatoptions);
<title>Formula</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<?php
+
if (!empty($CFG->additionalhtmlhead) && stripos($CFG->additionalhtmlhead, 'MathJax') !== false) {
- echo $CFG->additionalhtmlhead;
+ // For website where Mathjax is enabled using additional HTML in head.
+ echo $CFG->additionalhtmlhead;
+} else {
+ // For other website directly include MathJax.
+ echo "<script type=\"text/javascript\" async
+ src=\"https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-MML-AM_CHTML\">
+</script>";
}
?>
</head>