Last active
January 29, 2021 18:19
-
-
Save johnghill/0be4f1a543c115c432daf42399a854b8 to your computer and use it in GitHub Desktop.
Add MathJax to Articulate SCORM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Author: Zachary Daily | |
Source: https://community.articulate.com/discussions/rise-360/how-to-add-accessible-mathematics-to-your-rise-course-including-super-and-sub-scripts-and-formulas | |
Instructions: | |
- export SCORM 2004v4 from rise.articulate.com | |
- unzip | |
- locate ./scormcontent/index.html | |
- insert these scripts between the <head></head> tags of index.html | |
- zip | |
- Inline ($$) and display ($$ $$) LaTeX equations should render in your LMS | |
Date: 29 Jan 2021 | |
--> | |
<script> | |
var mathJaxPromise = null; | |
MathJax = { | |
tex: { | |
inlineMath: [['$', '$'],['\\(', '\\)']] | |
}, | |
startup: { | |
ready: () => { | |
MathJax.startup.defaultReady(); // Make sure MathJax is initialized | |
// Whenever there's a DOM change, check the dynamic content for LaTex | |
var observer = new MutationObserver(function() { | |
if(mathJaxPromise) { | |
mathJaxPromise.then(function() { | |
mathJaxPromise = MathJax.typesetPromise(); | |
}); | |
} | |
else { | |
mathJaxPromise = MathJax.typesetPromise(); | |
} | |
}); | |
observer.observe(document.body, { | |
attributes: true, | |
attributeFilter: ["id", "dir"], | |
attributeOldValue: true, | |
childList: true | |
}); | |
} | |
} | |
}; | |
</script> | |
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script> | |
<!-- Uncomment one of the scripts below to use either chtml or svg. I defaulted to SVG for widest support --> | |
<!-- svg (use scalable images) --> | |
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-svg.js"></script> | |
<!-- chtml (use html/fonts and css (beware of EDGE) --> | |
<!-- <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script> --> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment