varkor / quiver

A modern commutative diagram editor for the web.
https://q.uiver.app
MIT License
2.41k stars 80 forks source link

QuickLaTeX Integration #188

Open olynch opened 10 months ago

olynch commented 10 months ago

It would be cool to have integration with quicklatex.com. The API seems pretty easy to use: I can render a formula via the following curl call.

curl -d "formula=1+1&fsize=17px&fcolor=000000&mode=0&out=1&remhost=quicklatex.com" -X POST https://www.quicklatex.com/latex3.f

It returns a link to a png file, but if you just change the "png" at the end of the link to "svg", you get an svg version.

I'm imagining that there would be an additional export panel on quiver where you could push a button and it would send the tikz to quicklatex, and then you'd get a link to the svg. This would make it much easier to send people diagrams in places like email where you can't embed quiver.

The terms of service for quicklatex are that you just need to provide a link to quicklatex, so that shouldn't be a problem.

varkor commented 10 months ago

Thanks for sharing this, I wasn't aware of QuickLaTeX. This would be an alternative course of action to that proposed in #8, which involves including MathJax (in addition to KaTeX, which is what quiver currently uses) and using that to render the labels (since MathJax, unlike KaTeX, can export to SVG). There are advantages/disadvantages to both approaches. An advantage of QuickLaTeX is that it would be quicker to implement, but on the other hand, quiver tends to produce better diagrams than the corresponding LaTeX diagrams. I'll give it some thought.