Experimenting to replace $math$ (and related LaTeX syntaxes) with rendered formulas in CodeMirror 5.
See open issues, has known bugs!
⚠ Not fully abandoned, but close to it, I barely touched this in a decade ⚠
http://cben.github.io/CodeMirror-MathJax/demo.html
If you just want to use this for writing, check out mathdown.net powered by https://github.com/cben/mathdown.
I’m currently changing the API at will. If you want to use this for anything do contact me beni.cherniavsky@gmail.com — I’ll be glad to help.
After checking out, run this to materialize CodeMirror subdir:
git submodule update --init
I’m directly working in gh-pages branch without a master branch,
as that’s the simplest thing that could possibly work;
http://oli.jp/2011/github-pages-workflow/ lists several alternatives.
TODO: learn about bower publishing frontend code to npm
codemirror-widgets powered GitBook’s 2016 desktop editor beta, dunno what happened later.
It’s abstracted to supports rendering in-place various things (math, links, images), and seems generally well structured.
IIRC it was more systematic in some ways (e.g. multi-line formula support). But it’s been dormant since 2016 too.
https://Overleaf.com renders to PDF by real LaTeX, but can also render math in the editor, and is very battle-tested!
They’ve long been on CodeMirror 6, and in June 2026 upgraded to MathJax 4.
replace text + ability to mark ranges as “atomic” for cursor movement)