Serious LaTeX for markdown-it.
Plus the figures your agent wants to draw.
MathJax 4 for the math. Real TikZ, pgfplots, circuits and chemistry compiled in the browser. Mermaid, Graphviz, charts, sheet music and molecules from fenced blocks. One plugin, loaded piece by piece, with everything sanitised.
npm i markdown-it-latex-plus
Try the playground
Tell your agent what it can draw
Paste this into the system prompt of any model whose replies you render with the plugin. It is also exported as prompt, so your app can stay in step with the version it ships.
Playground
Type Markdown on the left. Math typesets as you type; figures render when their block is closed.
Use it
In the browser
import MarkdownIt from 'markdown-it'
import latexPlus from 'markdown-it-latex-plus'
const md = MarkdownIt().use(latexPlus)
node.innerHTML = md.render(text) // instant, cached work included
md.latexPlus.hydrate(node) // fills in whatever is new
Call both after every chunk while a reply streams. Finished formulas and figures come straight from the cache, so nothing flickers.
On the server
const md = MarkdownIt().use(latexPlus)
const html = await md.latexPlus.render(text)
const css = md.latexPlus.css()
Math is typeset in Node. Figures are sent as their source and drawn by hydrate() on the client.
Options, security notes and self-hosting are in the docs.