repl: Add LaTeX mimetype support#44525
Conversation
|
impossible to pass check_style thanks to the spell check targeting the .typ files |
|
tests should pass now, was failing because of rkyv blanket impls; rkyv was brought in by typst. Even tho tests may be passing now, it's worth discussion on if it is ok to bring in typst + mitex and their large dependency chains. do not know zed precedence for bringing in dependencies with pr, would like to know. Could be worth it for latex support? |
|
@rgbkrk would want you to weigh in on my approach here before i continue this path haha |
|
Since I've been a bit more away from Zed, I haven't been sure about how much the Zed folks want to add in more dependencies like this but it would make sense for scientific users. @mikayla-maki this adds in a new crate that would let use render LaTeX in the repl (and elsewhere if that were practical, like in Markdown). |
|
In a chat, @MrSubidubi noted that someone figured out how to make ReX use GPUI for rendering. I'd be interested in what you think: https://github.com/lnay/latex-gpui-experiment. Based on KenyC/ReX#23 we might be able to make the base ReX crate adapt well to GPUI. |
|
@rgbkrk This seems promising, i can try to draft a prototype with ReX as long as ReX is feasible to include in zed |
Adds latex mimetype support to the repl. Also contains my svg support pr
It does this by taking latex mimetype outputs and converting the raw latex to typst using mitex, then using the typst and typst svg crates to render that typst as a svg. Then that svg is rendered in the same way that other svgs are rendered. This method is crude but could ostensibly also be used to add support for latex rendering to markdown and other places in zed where latex is needed
In order to avoid bringing in the typst-kit crate which does a bunch of weird networking things and would probably break dependencies, I chose to statically embed all of the .typ files that mitex requires into the binary and then feed them to typst by creating a minimal typst world
Addresses #9778's latex mimetype support check box and ideally #10899
Release Notes: