{"id":1592,"date":"2020-02-21T10:33:07","date_gmt":"2020-02-21T10:33:07","guid":{"rendered":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/?p=1592"},"modified":"2020-02-21T10:33:26","modified_gmt":"2020-02-21T10:33:26","slug":"using-mathml-in-a-moodle-page","status":"publish","type":"post","link":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/posts\/1592","title":{"rendered":"Using MathML with Moodle"},"content":{"rendered":"<p>In my previous blog post\u00a0<a href=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/posts\/1585\">Generating MathML Code for Equations with MathType<\/a>\u00a0I showed how to get MathML for a equation you have created with MathType. In this post I show how this MathML code can be inserted to a Moodle page.\u00a0You need <a href=\"https:\/\/docs.moodle.org\/38\/en\/MathJax_filter\">MathJax<\/a> filter enabled in Moodle.<\/p>\n<p>If you insert the MathML code into a Moodle page it is unlikely to be displayed correctly. When I inserted the MathML code into a Moodle page this is how it was displayed.<\/p>\n<figure id=\"attachment_1594\" aria-describedby=\"caption-attachment-1594\" style=\"width: 1359px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/MathML-before-setting-filter.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1594\" src=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/MathML-before-setting-filter-1024x222.png\" alt=\"MathML is displayed as garbage Moodle\" width=\"1359\" height=\"294\" srcset=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/MathML-before-setting-filter-1024x222.png 1024w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/MathML-before-setting-filter-300x65.png 300w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/MathML-before-setting-filter-768x166.png 768w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/MathML-before-setting-filter.png 1354w\" sizes=\"(max-width: 1359px) 100vw, 1359px\" \/><\/a><figcaption id=\"caption-attachment-1594\" class=\"wp-caption-text\">Moodle page with incorrect display of math symbols<\/figcaption><\/figure>\n<p>This issue is discussed in various\u00a0<a href=\"https:\/\/moodle.org\/mod\/forum\/discuss.php?d=260070\">Moodle forums<\/a>. It is quick and easy to correct this. You need to change settings so that MathML will be correctly displayed by the current MathJax filter. Go to:<\/p>\n<p><strong> Site administration &gt; Plugins &gt; Filters &gt; MathJax &gt; Additional equation delimiters <\/strong> and add the delimiter <strong>&lt;math <\/strong>to the existing delimiters and save changes.<\/p>\n<figure id=\"attachment_1595\" aria-describedby=\"caption-attachment-1595\" style=\"width: 788px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/additional-delimiter.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-1595\" src=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/additional-delimiter.jpg\" alt=\"Screen showing how to add &lt;math as an additional delimiter\" width=\"788\" height=\"257\" srcset=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/additional-delimiter.jpg 788w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/additional-delimiter-300x98.jpg 300w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/additional-delimiter-768x250.jpg 768w\" sizes=\"(max-width: 788px) 100vw, 788px\" \/><\/a><figcaption id=\"caption-attachment-1595\" class=\"wp-caption-text\">Add additional delimiters to MathJax filter<\/figcaption><\/figure>\n<p>Now when you refresh the page where you inserted MathML code it should correctly display it.<\/p>\n<figure id=\"attachment_1597\" aria-describedby=\"caption-attachment-1597\" style=\"width: 758px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/mathml-equation.png\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-1597\" src=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/mathml-equation-1024x285.png\" alt=\"Correctly Displayed MathML Equation\" width=\"758\" height=\"211\" srcset=\"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/mathml-equation-1024x285.png 1024w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/mathml-equation-300x83.png 300w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/mathml-equation-768x213.png 768w, https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-content\/uploads\/2020\/02\/mathml-equation.png 1130w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/a><figcaption id=\"caption-attachment-1597\" class=\"wp-caption-text\">Correctly Displayed MathML Equation<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my previous blog post\u00a0Generating MathML Code for Equations with MathType\u00a0I showed how to get MathML for a equation you have created with MathType. In&hellip;<\/p>\n","protected":false},"author":10,"featured_media":1573,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36,68],"tags":[26,157,150,156],"_links":{"self":[{"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/posts\/1592"}],"collection":[{"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/comments?post=1592"}],"version-history":[{"count":3,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/posts\/1592\/revisions"}],"predecessor-version":[{"id":1599,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/posts\/1592\/revisions\/1599"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/media\/1573"}],"wp:attachment":[{"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/media?parent=1592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/categories?post=1592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ucem.ac.uk\/onlineeducation\/wp-json\/wp\/v2\/tags?post=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}