在github wiki中的LaTeX数学

时间:2014-03-06 22:00:54

标签: github latex wiki

是否可以使用github repo wiki以任何方式包含LaTeX风格的数学?谷歌搜索意味着github不再允许像MathJax这样的东西,但大多数参考文献已经存在多年了。在github wikis中包含LaTeX格式的数学有哪些(如果有的话)替代品?

5 个答案:

答案 0 :(得分:14)

您可以使用chart.apis.google.com将LaTeX公式渲染为PNG。 它与Githhub的降价很好地合作:

示例(降价):

The ratio of the momentum to the velocity is
the relativistic mass, m.

![f1]

And the relativistic mass and the relativistic
kinetic energy are related by the formula:

![f2]

Einstein wanted to omit the unnatural second term
on the right-hand side, whose only purpose is
to make the energy at rest zero, and to declare
that the particle has a total energy, which obeys:
![f3] which is a sum of the rest energy ![f4]
and the kinetic energy.

[f1]: http://chart.apis.google.com/chart?cht=tx&chl=m=\frac{m_0}{\sqrt{1-{\frac{v^2}{c^2}}}}
[f2]: http://chart.apis.google.com/chart?cht=tx&chl=E_k=mc^2-m_0c^2
[f3]: http://chart.apis.google.com/chart?cht=tx&chl=E=mc^2
[f4]: http://chart.apis.google.com/chart?cht=tx&chl=m_0c^2

<强> HTTPS

Github Enterprise的某些安装会拒绝http并仅在您使用https

时才有效

<强>渲染: enter image description here

答案 1 :(得分:11)

对于简单公式(例如指数等),您可以只使用可用的渲染语言。例如,使用Textile,您可以:

_E = mc ^2^_

Thiw将呈现为:

  

     

_用于斜体样式,^用于上标。

您可以在Markdown中添加一些HTML:

*E = mc<sup>2</sup>*

你可以在这个地方看到它的实际效果:

  

E = mc 2

如果您正在寻找对复杂数学公式的支持,那么您没有比使用为您生成图像的第三方服务更好的选择。 mathUrl看起来很有趣。

作为输入,我们给它E = mc ^ 2,它会生成以下链接:

  

     

http://mathurl.com/render.cgi?E%20%3D%20mc%20%5E%202%5Cnocache

答案 2 :(得分:0)

要将数学方程式添加到GitHub wiki,我使用了mathURL建议的Ionică。它将渲染您的LaTeX方程式。将.png附加到生成的网址,并将该网址作为图片中的图片(块或内联)使用。

答案 3 :(得分:0)

有一个很好的解决方案-使用TeXify github插件-有关此插件的更多详细信息,并解释为什么可以在该answer中找到这种好方法。

答案 4 :(得分:0)

GitLab Wiki和markdown支持公式。因此,我移动了多个存储库。