LaTeX support
Is LaTeX support planned?
LaTeX in general i probably too much for this crate. With that said, a subset for math would definitely be nice to have.
seems like pulldown_cmark has merged the support for math expressions: https://github.com/pulldown-cmark/pulldown-cmark/pull/734 (it will emit Event::InlineMath and Event::DisplayMath events that we can handle directly)
we could then use MathJax to render it to an SVG and draw it (this crate just shells out to Node or a headless chrome instance)
i think this would be a really cool feature to have, i'll start prototyping on it tomorrow
It would be really nice. It's just incredibly painful that node or headless chrome must be involved. I would have preferred to avoid that.
It would be really nice. It's just incredibly painful that node or headless chrome must be involved. I would have preferred to avoid that.
True, I guess we could embed a JavaScript engine like QuickJS or Duktape and make MathJax run in it? :P I haven't found any pure Rust TeX -> SVG renderer, aside from Tectonic which seems to only render to HTML There are also libraries that shell out to ghostscript, but I think Node and Chrome are much more common
Yeah. Your first suggestion is the most sane option. Maybe this gives me an excuse to add support for mermaid too :thinking:
There is definitely a lot to consider. For instance the headless chrome feature in that crate fetches mathjax from CDN and as I would expect most people to use that backend it would mean that it would require internet access to work. At least that would have to be documented.
or we can just leave it to the user and make them pass a closure that will render LaTeX into a texture
I don't think moving the problem to the user is the solution :laughing:
I don't think moving the problem to the user is the solution :laughing:
I think that's the best option, since there's no easy way of rendering LaTeX in Rust. The implementation would also be different when compiling for web, since there you can directly interface with the browsers' JS engine
I think that's the best option, since there's no easy way of rendering LaTeX in Rust. The implementation would also be different when compiling for web, since there you can directly interface with the browsers' JS engine
True. I did not think about for web.