mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

Math Macros from Inline Equations

Open rowanc1 opened this issue 1 month ago • 0 comments

Jupyter currently supports creating math macros like:

$\newcommand{\a}{\alpha}$
$\a$

However, mystmd requires these to be defined in the frontmatter. To be compatible with jupyter-lab and notebooks, we should likely support the existing markdown-math capabilities.

This would involve a transform on the node, interpreting the latex (maybe only if newcommand is found) and pulling out the macros. In our latex parser, we already have all this code and logic actually, so not a huge lift.

Note, these fail in github's renderer, vscode's notebook, but do work in google colab.

See also: jupyter-book/jupyterlab-myst#259

rowanc1 avatar Nov 02 '25 23:11 rowanc1