# Markdown formula display in GitHub

When I write an R markdown file in RStudio and Knit HTML, my formulas (inline using $..$ or display using $$..$$) can be displayed properly. However, when I push my .md file to GitHub, these formulas cannot be displayed. They only show $..$ and $$..$$. Is there a way to let GitHub know how to parse latex formulas? Thanks!

• No. Github does not support Mathjax, except in their Wikis. The only alternative is to generate your HTML locally using jekyll and pushing it to github. – Ramnath Sep 19 '12 at 20:46
• @Ramnath: thanks! – alittleboy Sep 19 '12 at 20:58

Is there a way to let GitHub know how to parse latex formulas?

Some sites provide users with a service that would fit your need without any javascript involved: on-the-fly generation of images from url encoded latex formulas.

given the following markdown syntax

![equation](https://latex.codecogs.com/gif.latex?1%2Bsin%28mc%5E2%29%0D%0A)

it will display the following image

$1+sin(mc^2)$

Note: In order for the image to be properly displayed, you'll have to ensure the querystring part of the url is percent encoded. You can easily find online tools to help you with that task, such as www.url-encode-decode.com

• Thanks! I tried it in mdcharm, seems to work without urlencoding. – laike9m Nov 27 '13 at 5:56
• By using svg.latex in the link, you get a nice SVG image file. – Dylan Richard Muir Feb 21 '17 at 13:11

I also looked for how to render math on GitHub pages, and after a long time of research I found a nice solution.

I used KateX to render formulas server side: it is really faster than MathJaX.

Please note that same solution could be arranged to work also client side, but, I prefer server side rendering, cause

1. you know your server environment, but you don't know the client environment of your visitors
2. it is also faster client side, if the formulas are rendered on the server, only once.

I wrote an article showing the steps, I hope it can help math divulgation: see Math on GitHub Pages.