Wolfram alpha 如何用数学表达式生成图像?
我只是好奇是否有一个库可以将数学表达式(非乳胶)转换为像 Wolfram alpha 那样清晰的图像。
例如,(n^2+5x+3)/n 应输出 这个。
I was just curious as to whether or not there's a library that converts mathematical expressions (non latex) to crisp looking images like wolfram alpha does.
For example, (n^2+5x+3)/n should output this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
从此处开始。但看起来,实现这一点并不太简单,在 MathML 中,您可以只在浏览器中显示公式,但不能将其渲染为图像。请记住,整个 Mathematica 软件框架非常强大,并且肯定具有此类功能的内置功能,它支持 WolframAlpha。
编辑:https://math.stackexchange.com/也这样做(MathML)。,例如< a href="https://math.stackexchange.com/questions/3405/convergence-of-npn-where-pn-sum-j-lceil-n-2-rceiln-1-pj-over-j">这个 帖子。询问他们是如何做到的(在元上)。
再次编辑:tadaaaa,正是您所需要的http:// /www1.chapman.edu/~jipsen/mathml/asciimath.html
Begin here. But as it looks, it's not too simple to achieve this and in MathML, you can just show the formulas in the Browser, but not render it to images. Remember that the whole Mathematica software framework, which is extremely powerful and for sure has builtin functionality for such things, stands behind WolframAlpha.
EDIT: https://math.stackexchange.com/ does it too (MathML)., e.g. this post. Ask them how they do it (on meta).
EDIT again: tadaaaa, just what you needed http://www1.chapman.edu/~jipsen/mathml/asciimath.html
尝试使用
(n^2 + 5 x + 3)/n // ClassicForm // Rasterize
。Try using
(n^2 + 5 x + 3)/n // TraditionalForm // Rasterize
.不是您问题的直接答案,因为它是基于 LaTeX 的,但有一个名为 的 Javascript 库jsmath 执行此类转换。这篇 文章对此进行了解释和其他替代方案。
Not a direct answer to your question because it is LaTeX based, but there is a Javascript library called jsmath that does such conversion.This post explains it and other alternatives.