MathJax
MathJax is a cross-browser
JavaScript library that displays mathematical notation in web browsers, using
MathML,
LaTeX and
AsciiMath markup. MathJax is released as open-source software under the Apache License. (
Wikipedia:MathJax
)
Use MathJax in TWiki:
Step 1: Include the mathjax JavaScript from a CDN:
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js?config=TeX-MML-AM_CHTML"> </script>
Including this JavaScript could be done by a plugin, or a site-wide preferences setting, so that you could simply write %USEMATHJAX% in a topic to use MathJax. Or, you could add it to a TWiki template so that it is available in all topics by default.
Step 2: Enter math text:
| Language | You write | You get |
| TeX: | \[x = {-b \pm \sqrt{b^2-4ac} \over 2a}\] | \[x = {-b \pm \sqrt{b^2-4ac} \over 2a}\] |
| MathML: | <math><msqrt><mi>x</mi></msqrt></math> | |
| AsciiMath: | `a^2 + b^2 = c^2` | `a^2 + b^2 = c^2` |
--
Contributors:
Peter Thoeny - 2020-12-05
Discussion