简体   繁体   English

katex 方程到图像(png,jpg)

[英]katex equations to image(png, jpg)

I am using katex in my web application to render Math equations.我在我的 web 应用程序中使用 katex 来渲染数学方程。 I need to convert the math equation into an image(png or jpg).我需要将数学方程转换为图像(png 或 jpg)。 I tried html2canvas.js, but it could not able to convert some symbols.我尝试了 html2canvas.js,但它无法转换某些符号。 Is there any front-end tools to convert math equations to image.?是否有任何前端工具可以将数学方程式转换为图像。?

To generate an image client-side you'd want the formula rendered to a canvas then save that to a file.要生成图像客户端,您需要将公式呈现到 canvas 然后将其保存到文件中。 There is a feature request for render to canvas.有一个渲染到 canvas 的功能请求 A long while ago I had written an implementation .很久以前我写了一个实现 But it wasn't merged upstream and I haven't kept up with changes there.但它没有在上游合并,我也没有跟上那里的变化。 If you don't need recent KaTeX features you might still give that codebase of mine a try.如果您不需要最近的 KaTeX 功能,您仍然可以尝试我的代码库。

Otherwise there definitely is interest in getting a solution included.否则,肯定有兴趣获得包括在内的解决方案。 Ideally a solution would implement and then use an intermediate representation to be shared by all render backend.理想情况下,解决方案将实现然后使用由所有渲染后端共享的中间表示

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM