Note markdown-it-dollarmath is still preferential here I think, since it supports more parsing configuration, including double-dollar math in inline contexts (as Jupyter allows) and labels, and also plugin renders, so mathjax as well as katex. It also lacks integrating typing.
Maybe we even eventually propose to Microsoft to use this package instead 😬
We should look at markdown-it-katex though and see if there is anything we can learn/use from it. For example there the parsing rule is:
Copied from Slack:
Interesting VS Code update; they now support dollar-math by default: https://code.visualstudio.com/updates/v1_58#_math-formula-rendering-in-the-markdown-preview (in both the Markdown files/previews and Jupyter Notebook). The code is here: https://github.com/microsoft/vscode/tree/main/extensions/markdown-math, which actually provides a good "exemplar" for https://github.com/executablebooks/myst-language-support (mainly stuff I am already doing), which uses https://github.com/waylonflinn/markdown-it-katex.
Note
markdown-it-dollarmath
is still preferential here I think, since it supports more parsing configuration, including double-dollar math in inline contexts (as Jupyter allows) and labels, and also plugin renders, so mathjax as well as katex. It also lacks integrating typing.Maybe we even eventually propose to Microsoft to use this package instead 😬
We should look at markdown-it-katex though and see if there is anything we can learn/use from it. For example there the parsing rule is:
whereas here it is: https://github.com/executablebooks/markdown-it-dollarmath/blob/859692bdd8886e513696e3f57cc91dbb79f4b944/src/index.ts#L42
So should look what one is better.
We should also have a think at how this plays with markdown-it-dollarmath and markdown-it-amsmath (and what @rowanc1 was looking into about standardising their tokens in https://github.com/executablebooks/markdown-it-amsmath/issues/3).