2014-03-06 43 views
21

以github回購wiki的方式,可以包含LaTeX風格的數學嗎?谷歌搜索意味着github不再允許像MathJax這樣的東西,但大多數引用已經過去了幾年。在github wiki中包含LaTeX格式的數學有哪些(如果有的話)替代方案?github wiki中的乳膠數學

+0

見http://stackoverflow.com/questions/11256433 – nulltoken

+6

我希望過去兩年會有更新。對於任何相當複雜的事情,使用URL編碼是荒謬的。 – Aurelius

+0

現在呢?這是2017年1月......我仍然不確定要使用什麼? – ComputerScientist

回答

9

對於簡單的公式(如指數等),您可以只使用可用的渲染語言。例如,使用紡織,你可以這樣做:

_E = mc ^2^_ 

Thiw將呈現爲:

_用於斜體和^爲標。

你可以做同樣的事情在降價增加了一些HTML:

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

你可以看到它的行動在這個地方:

E = MC

如果你正在尋找爲了支持複雜的數學公式,那麼比使用第三方服務爲您生成圖像沒有更好的選擇。 mathUrl看起來很有趣。

由於輸入我們給它E = mc^2並生成以下鏈接:

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

0

到數學公式添加到GitHub的維基,我用mathURL通過的建議Ionică。它會渲染你的LaTeX方程。將.png附加到生成的網址,並將該網址用作標記中的圖片(塊或內嵌)。

+0

雖然它是一個非常有限的選項。它不支持加載LaTeX包,因此您必須堅持非常基礎。 – rbaleksandar

7

您可以使用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 

渲染: enter image description here

+0

它看起來像我需要一個額外的\ \乳膠命令像\ frac正確使用您的方法呈現,例如''[f1]:http://chart.apis.google.com/chart?cht=tx&chl= m = \\ frac {m_0} {\\ frac {v^2} {c^2}}}}''' – muraly

+0

我會說你只是寫單反斜槓,它在stackoverflow呈現我通過複製粘貼到Chrome地址欄來測試它。 –