hypermd-mathjax
In HyperMD, Use MathJax to render TeX formulars.
How to use
⚠️ First of all, add mathjax-config into your HTML, before your .js script tag.
More detail about the config can be found here. My personal favorite config is:
Then...
- install
mathjax
andhypermd-mathjax
import
before creating HyperMD editor- create HyperMD editor
For webpack / parcel
After adding mathjax-config (see above) to HTML page, install the packages: npm install --save hypermd-mathjax mathjax
const your_textarea = documentconst editor = HyperMD
For requirejs (example)
Install the packages: npm install --save hypermd-mathjax mathjax
In your HTML:
I'm using MathJax to render $f(a) = \frac{1}{2\pi i} \oint\frac{f(z)}{z-a}dz$ <!-- **mathjax-config** HERE (see above) --> <!-- 👈 IMPORTANT -->
As for your main.js
, here is an example.
For Plain Browser Env
Why hurting yourself? The bundlers and module loaders are the future!
See the source of example file. Basically, all you need is adding few lines after CodeMirror and HyperMD, before creating your editor:
<!-- **mathjax-config** HERE (see above) -->
Develop
- (if needed) update
pbe.manifest.json
and define modules' global var name npm run dev
- Start test. You have to refresh the page manually...