在第三方网站上渲染 LaTeX?
网络上有一些网站将 LaTeX 呈现为更易读的形式,例如 Wikipedia、一些 Wordpress 博客和 MathOverflow。他们可能使用图像、MathML、jsMath 或类似的东西。
网络上还有其他网站,LaTeX 内联显示且不渲染,例如 arXiv、各种数学论坛或我的电子邮件。事实上,在 arXiv 论文的摘要中包含原始 LaTeX 的情况很常见,例如 这篇论文 。
是否有适用于 Firefox 的插件,或者是否可以编写一个插件,在本身不提供渲染机制的页面中渲染 LaTeX? (LaTeX 将包含在美元符号内,例如 $\pi$。请参阅上面的 arXiv 链接。)
一些注释:
可能无法呈现某些代码,因为作者经常直接从源 TeX 文件中复制粘贴代码,其中可能包含“\cite{foo}”或未定义的命令之类的内容。这些应该单独保留。
此问题是 MathOverflow 问题的转发< /a> 因与数学无关而被关闭。那里有一个答案,这是有帮助的,但也许 Stack Overflow 可以提供更好的答案。
我经常编程,但 Javascript 不是我的专长,因此“看看这个库”之类的评论对我来说并不是特别有帮助(但可能对其他人有帮助)。 p>
There are some sites on the web that render LaTeX into some more readable form, such as Wikipedia, some Wordpress blogs, and MathOverflow. They may use images, MathML, jsMath, or something like that.
There are other sites on the web where LaTeX appears inline and is not rendered, such as the arXiv, various math forums, or my email. In fact, it is quite common to see an arXiv paper's abstract with raw LaTeX in it, e.g. this paper.
Is there a plugin available for Firefox, or would it be possible to write one, that renders LaTeX within pages that do not provide a rendering mechanism themselves? (The LaTeX would be enclosed within dollar signs, e.g. $\pi$. See the arXiv link above.)
Some notes:
It may be impossible to render some of the code, because authors often copy-paste code directly from their source TeX files, which may contain things like "\cite{foo}" or undefined commands. These should be left alone.
This question is a repost of a question from MathOverflow that was closed for not being related to math. There is one answer there, which is helpful, but perhaps Stack Overflow can provide better answers.
I program a lot, but Javascript is not my specialty, so comments along the lines of "look at this library" are not particularly helpful to me (but may be to others).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个 Greasemonkey 脚本可以检测内联 LaTeX 并将其呈现为 MathML。它的作用非常好。
There is this Greasemonkey script that detects and renders inline LaTeX as MathML. It works pretty well at what it does.
现在有一个针对 Gmail 的解决方案:GmailTeX http://alexeev.org/gmailtex.html 编写瓦列里·阿列克谢耶夫.
There is now a solution for Gmail: GmailTeX http://alexeev.org/gmailtex.html written by Valery Alexeev.