LaTeX 相当于 Google Chart API
我目前正在寻找不同的解决方案,将二维数学公式放入网页中。 我认为维基百科解决方案(从 LaTeX 源代码生成 png 图像)已经足够好了,直到我们在网络浏览器中获得对 MathML 的支持。
我突然意识到,也许可以为数学公式创建一个等效的 Google Charts API。 这已经完成了吗? 由于 LaTeX 代码中涉及奇怪的字符,这是否有可能?
我想点击像 Latex2png.org/api/?eq="E = mc^2" 这样的网址并得到以下响应:
编辑: 感谢到目前为止的回答。 然而,我已经知道有几种从 Latex 源代码生成 png 图像的工具(在线和命令行),但我正在寻找的是一种通过 Http GET 请求获取图像的简单方法。 也许这样的服务并不存在。
I'm currently looking at different solutions getting 2 dimensional mathematical formulas into webpages. I think that the wikipedia solution (generating png images from LaTeX sourcecode) is good enough until we get support for MathML in webbrowsers.
I suddenly realized that it might be possible to create a Google Charts API equivalent for mathformulas. Has this already been done? Is it even possible due to the strange characters involved in LaTeX-code?
I would like to hit an url like latex2png.org/api/?eq="E = mc^2" and get the following response:
edit:
Thanks for the answers sofar. However, I am already aware of several tools to generate png images from latex source code (both online and from my commandline), but what I was looking for was a simple way to get the image via an Http GET request. Perhaps such a service does not exist.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
更新
正如@hughes(和其他人)指出的那样,以前的 Google Chart API 已被弃用。
我编写的示例截至 2015 年 9 月仍然有效,但现在应使用一个新的示例 (文档):
旧答案
Google Chart 可以做到(文档):
http://chart.apis.google.com/chart?cht=tx&chl=%5CLaTeX
我正在使用这个使用 Google Docs,因为它还不支持数学。
Update
As @hughes (and others) pointed out, the previous Google Chart API has been deprecated.
The example I wrote still works as of Sept 2015, but a new one shall be used now (documentation):
Old answer
Google Chart can do it (Documentation):
http://chart.apis.google.com/chart?cht=tx&chl=%5CLaTeX
I'm using this with Google Docs, because it doesn't support math yet.
chart.apis.google 的背景颜色已更改
或 < Strong>chart.apis.google 背景色透明 并调整大小
为了提高可读性,需要对 URL 进行解码。
数据结构如下所示
chart.apis.google with background color changed
or chart.apis.google with background color transparent and resized
For better readability URL needs to be decoded.
Data structure looks like this
您可以首先尝试数学公式在线图像生成器。
mathurl 是 TinyURL.com 的数学版本。 它允许您使用短网址引用 LaTeXed 数学表达式。 例如, http://mathurl.com/?5v4pjw 将显示 [LaTeX 输出图像],然后您可以编辑。 有关mathurl 帮助页面的更多详细信息
You could try the Online image generator for mathematical formulas for a start.
mathurl is a mathematical version of TinyURL.com. It allows you to reference LaTeXed mathematical expressions using a short url. For example, http://mathurl.com/?5v4pjw will show [LaTeX output Image] which you can then edit. More details on mathurl’s help page
我刚刚遇到 MathJax Ajaxian [通过 Wayback Machine]:
输出非常漂亮,而且都是纯 HTML 和 CSS,这使得它具有可扩展性和可选择性。 目前表现有点低迷,但这是公认的。
I just ran across MathJax on Ajaxian [via Wayback Machine]:
The output is remarkably beautiful, and it's all pure HTML and CSS, which makes it scalable and selectable. Performance is currently a bit sluggish, but this is recognized.
正如大家所说,已经有许多服务可以做到这一点。 这是我多次使用过的另一个简单的方法(如果需要,您可以将其本地安装在服务器上):
http://www.codecogs.com/components/equationeditor/equationeditor.php
As everyone has said, there are many services that do this already. Here is another easy one that I've used a number of times (and you can install it locally on your server if necessary):
http://www.codecogs.com/components/equationeditor/equationeditor.php
我会仔细研究 MediaWiki LaTeX 支持 是如何做到这一点的,并借鉴那里。
I'd take a good look at how the MediaWiki LaTeX support does it and borrow from there.
请查看此站点,了解无需安装任何软件即可创建 TeX 文档的方法。 然后,您可以使用任何屏幕捕获方法对结果图像进行片段化,并将结果图像嵌入到任何网站中。
访问 http://sharelatex.com
该软件可以免费使用,但您需要注册才能创建文档。
Please check out this site for a way to create TeX documents without any software installed. You can then snippet the result image with any screen capture method and embed the resulting image into a any website.
Go to http://sharelatex.com
The software is free to use, but you need to register to create documents.