Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LaTeX math in github wikis

Tags:

github

latex

wiki

Is it possible to include LaTeX-style math in any way with github repo wikis? Googling implies github no longer allows things like MathJax, but most references are years old. What (if any) alternatives are there to including LaTeX-formatted math in github wikis?

like image 644
Aurelius Avatar asked Mar 06 '14 22:03

Aurelius


People also ask

Can you use LaTeX in GitHub Markdown?

You can now use LaTeX style syntax to render math expressions within Markdown inline (using $ delimiters) or in blocks (using $$ delimiters).

Can you use LaTeX in GitHub?

About writing mathematical expressions To enable clear communication of mathematical expressions, GitHub supports LaTeX formatted math within Markdown.

Can you do math in Markdown?

We are pleased to announce that math expressions can now be rendered natively in Markdown on GitHub. Support for displaying math expressions has been a highly requested feature for over 8 years.

How do I put an equation in Markdown?

To insert in-line math use the $ symbol within a Markdown cell. For example, the text $this_{is}^{inline}$ will produce: t h i s i s i n l i n e .


4 Answers

You can use chart.apis.google.com to render LaTeX formulas as PNG. It work nicely with Githhub's markdown:

Example (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

Some installations of Github Enterprise reject http and work only if you use https

Rendered: enter image description here

like image 54
Viliam Simko Avatar answered Oct 11 '22 17:10

Viliam Simko


For simple formulas (such as exponents etc) you may one just to use the available render languages. For example, using Textile, you can do:

_E = mc ^2^_

Thiw will be rendered as:

_ is used for italic style and ^ for superscript.

You can do the same thing in Markdown adding some HTML:

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

You can see it in action in this very place:

E = mc2

If you're looking for support for complex math formulas, then you have no better option than using a third-party service generating images for you. mathUrl looks interesting.

As input we give it E = mc ^ 2 and it generates the following link:

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

like image 31
Ionică Bizău Avatar answered Oct 11 '22 19:10

Ionică Bizău


There is good solution for your problem - use TeXify github plugin - more details about this plugin and explanation why this is good approach you can find in that answer.

like image 2
Kamil Kiełczewski Avatar answered Oct 11 '22 18:10

Kamil Kiełczewski


GitLab Wiki and markdown supports formulas. I moved multiple repos for this reason.

like image 1
rjmoggach Avatar answered Oct 11 '22 17:10

rjmoggach