marimo icon indicating copy to clipboard operation
marimo copied to clipboard

Add typst cell type

Open hannesknoll opened this issue 3 weeks ago • 2 comments

Description

As much as I love markdown, for some technical topics I'd much rather write in a typesetting language.

Typst is a perfect fit in my opinion. Its syntax is close to markdown but as extensible and programmable as Latex and it compiles super fast.

It also offers html and svg export which makes it very nice to use in webapps such as marimo.

Suggested solution

Typst has recently released an html export feature (which is still unstable though). I tried to give the output of the html export into mo.Html which worked fin, but was lacking some styling. A thing I also tried was typsts svg export. This is way more stable and also worked.

Are you willing to submit a PR?

  • [x] Yes

Alternatives

No response

Additional context

No response

hannesknoll avatar Nov 08 '25 08:11 hannesknoll

Instead of a new cell type, we might prefer embedding Typst in markdown, in the same way that we support embedding LaTeX in markdown. We use pymdownx, which provides a LaTeX extension for Python Markdown. Have you thought about asking them for Typst support?

akshayka avatar Nov 13 '25 17:11 akshayka

Didn't do that yet. But afaik only LaTeX formulars are supported and not the entire LaTeX syntax. I'd much rather have cells that fully support writing an entire document in typst and think it would be possible with the html export. Is there an api or something to create plugins for new cell types?

hannesknoll avatar Nov 16 '25 19:11 hannesknoll

We do not have an extension API currently, sorry. All cells in marimo are just Python. You might consider implementing a UI plugin with anywidget

akshayka avatar Nov 17 '25 03:11 akshayka