[英]LaTeX math in github wikis
是否可以在 github repo wiki 中以任何方式包含 LaTeX 风格的数学? 谷歌搜索暗示 github 不再允许使用 MathJax 之类的东西,但大多数参考文献已有多年历史。 在 github wiki 中包含 LaTeX 格式的数学有哪些(如果有)替代方案?
您可以使用chart.apis.google.com
将LaTeX公式呈现为PNG。 它与Githhub的降价很好地配合:
示例(Markdown):
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
才能使用
对于简单的公式(例如指数等),您可以只使用可用的渲染语言。 例如,使用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
GitLab Wiki和markdown支持公式。 出于这个原因,我搬了多个回购。
现在 GitHub正式支持在 wiki 中显示 Mathjax !
在 Markdown 中,只需将$
用作内联公式的分隔符,将$$
用作显示公式的分隔符。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.