I have tried every approach for embedding equations into my rst markup on Github, but none seem to work:
.. math::
\beta = \alpha + \epsilon^2
and
.. raw:: latex html
\[ \beta = \alpha + \epsilon^2 \]
as well as adding a MathJax script to the rst file.
Since I largely develop statistical software, its important to be able to add math to my wiki pages and docs. Is this something that will be added in the near future, or is there a workaround?
Do any of the other markup languages have github support for math markup?
:+1: I don't know about the other markups, but the .. math:: and :math: directives are very common in reStructuredText. This would be a win, IMO..
+1.
+1
We have experimented with math support for various markup formats in the past, but haven't found any that are easy to maintain (MathJax) or free of security issues (latex).
Closing in favor of #274.
Can mathml.css (via MDN) be a possible solution?
Its test page looks fine in most browsers. Probably only IE9/8 would be an issue since they still have quite significant shares.
I personally use MathML output for math_output in reST, if GitHub allows MathML, then this would not only benefit reST users, but also the markups that allow the use/passthrough of MathML.
So far, only Firefox and Safari support native MathML, but with this CSS, it wouldn't matter.
math_output needs to be changed.Even GitHub does not, would you consider to use HTML math.css output, with docutils' math.css? In Firefox, it doesn't look as good as MathML, but it's better than nothing.
Any updates on this?
+1 + 10 from here: https://github.com/github/markup/issues/274
Please upvote this feature request. It seems like it got into the internal feature request list. It might gain more traction if more people upvote it.
</sigh>
It's been nine years, guys. Math is kinda important. It'd be nice if GitHub supported math rendering – any math rendering. It doesn't particularly matter how this gets done, only that this does eventually get done. LaTeX is preferable, but MathJax is fine. Anything is fine, because the current ad-hoc situation is obscure CDN-hosted JavaScript hacks, which is probably worse than nothing and exposes everyone involved (including GitHub itself) to undue security, privacy, and performance concerns.
Note that GitHub already supports LaTeX math rendering in Jupyter notebooks. Amusingly, hijacking this support to render LaTeX math in README.md and README.rst files via GitHub-hosted URLs generated by external webapps (or just manually URL-encoding the LaTeX yourself) is then trivial. These include:
So GitHub already self-hosts arbitrary LaTeX math as globally accessible images (despite the supposed security and performance concerns) – but fails to integrate that support with most of its external rendering pipeline, leaving third-party converters to pick up the pieces. Some things make no sense. This is one of them.
And please don't lock this issue like you have every other popular issue on this topic (e.g., #274, #897). Locking issues is a great way to ensure nothing gets done... unless nothing getting done is the intended effect.
Most helpful comment
</sigh>It's been nine years, guys. Math is kinda important. It'd be nice if GitHub supported math rendering – any math rendering. It doesn't particularly matter how this gets done, only that this does eventually get done. LaTeX is preferable, but MathJax is fine. Anything is fine, because the current ad-hoc situation is obscure CDN-hosted JavaScript hacks, which is probably worse than nothing and exposes everyone involved (including GitHub itself) to undue security, privacy, and performance concerns.
Note that GitHub already supports LaTeX math rendering in Jupyter notebooks. Amusingly, hijacking this support to render LaTeX math in
README.mdandREADME.rstfiles via GitHub-hosted URLs generated by external webapps (or just manually URL-encoding the LaTeX yourself) is then trivial. These include:So GitHub already self-hosts arbitrary LaTeX math as globally accessible images (despite the supposed security and performance concerns) – but fails to integrate that support with most of its external rendering pipeline, leaving third-party converters to pick up the pieces. Some things make no sense. This is one of them.
And please don't lock this issue like you have every other popular issue on this topic (e.g., #274, #897). Locking issues is a great way to ensure nothing gets done... unless nothing getting done is the intended effect.