[FEATURE REQUEST] LaTeX Math in Markdown #23083
-
Hi. I am using a math snippet in my markdown readme file in my repository. This is the code:
This is how it looks like in my markdown preview as displayed by VS Code Markdown and Markdown MathJax plugins: But this is how it looks like on GitHub: GitHub does not render LaTeX Math notations. Why? As far as I know, it did in past. Why was that feature removed? Could you bring it back again? It breaks the page intended use. Users can get it working in GitHub pages with few extra lines of code in _ _config.yml _, but unfortunately that doesn’t work with the internal markdown renderer at the repo view. I could simply use a Chrome extension, but the downfall of the extension is that it tries to interpret the LaTeX code even inside code blocks or in in-line code notations, which is wrong. |
Beta Was this translation helpful? Give feedback.
Replies: 19 comments
-
Hi @polda18 , Thanks for this feedback! We’re always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I’ve logged your feature request in our internal feature request list. Though I can’t guarantee anything or share a timeline for this, I can tell you that it’s been shared with the appropriate teams for consideration. Cheers! |
Beta Was this translation helpful? Give feedback.
-
Thank you 😊 It’s really bad that math does not get recognised in inner GitHub markdown renderer. If I want to put math equation to the readme, it doesn’t display correctly (as intended), it displays as is written in code. Thank you for considering to include it 👍 |
Beta Was this translation helpful? Give feedback.
-
Thank you for bringing attention to this topic to the appropriate teams! One thing I suggest is using KaTeX instead of MathJax, if math support were to be implemented in the near future, due to its efficiency compared to MathJax. Although KaTeX does not support all mathematical functions MathJax supports, it does heavily reduce the loading time for markdown files infused with mathematical operations! Best regards! |
Beta Was this translation helpful? Give feedback.
-
Thanks, you’re the first one who reacts positively |
Beta Was this translation helpful? Give feedback.
-
Thanks for the advice, but this one I give away. I didn’t use either of the two |
Beta Was this translation helpful? Give feedback.
-
I think I know why. He has to hide so massively much lets say data, that it will show up real soon. I am speaking of experience now for what he did to me for putting me on that cc list. But I have already contacs with the source. |
Beta Was this translation helpful? Give feedback.
-
Is it possible for GitHub to switch the rendering engine to goldmark ? It has great math extension goldmark-mathjax |
Beta Was this translation helpful? Give feedback.
-
I realize that some of the reasons why this wasn’t implemented earlier are because of the speed of MathJax and the maintenance issues that come with it. I think Katex may help with the speed issue, and even if it still isn’t fast enough, GitHub can detect files with a lot of math equations and have the user toggle rendering on if needed while directly rendering files that have fewer equations. I’m not sure what sorts of maintenance issues it may bring, but since jupyter notebooks on GitHub already renders equations, it should not be that difficult to extend that to all of GitHub. |
Beta Was this translation helpful? Give feedback.
-
I’m looking forward to this feature been implemented. I am working on a markdown book with a good num of latex style characters, the process went 20% while I found that latex not shown on github, it is hard for me to repair this issue, which confused me so much. |
Beta Was this translation helpful? Give feedback.
-
It’s a bit late but hopefully this helps https://md-math.netlify.app/ . I’m progressively enhancing it and slowly refactoring, so if anyone has any issues with it, drop me a line and I’ll mediate as soon as. |
Beta Was this translation helpful? Give feedback.
-
I don’t understand. Is it really technically hard to add the feature? Given there’s already extension in chrome, I don’t think it’s hard. And this feature is obviously important to lots of GitHub users, specially those who in DS/ML domains. |
Beta Was this translation helpful? Give feedback.
-
+1 for this request. It’d be really nice for a slew of users who use GitHub repos for technical work of all kinds. |
Beta Was this translation helpful? Give feedback.
-
+1 It’d be super nice to have github support latex equations natively, though for now the hacks such as my compiler or PurplePi will do. |
Beta Was this translation helpful? Give feedback.
-
I forgot to include this the other day: Aside from alignment issues the big pitfall with using the renderer is that it is not theme-aware and will be unreadable on dark theme. |
Beta Was this translation helpful? Give feedback.
-
I created a small Chrome extension, xhub, to add math (and more) to GitHub pages. Pros:
Cons:
|
Beta Was this translation helpful? Give feedback.
-
Very nice solution @nschloe! |
Beta Was this translation helpful? Give feedback.
-
FYI they just released LaTeX support (using MathJax) yesterday: Render mathematical expressions in Markdown | GitHub Changelog |
Beta Was this translation helpful? Give feedback.
-
cxcorp:
👏t2: Welcome to the forums @cxcorp and thank you for sharing that solution!! Appreciate you closing the loop for folks ✨ |
Beta Was this translation helpful? Give feedback.
-
Thanks, finally! I can then uninstall the Chrome extension :slight_smile: EDIT: When is this feature going to roll out though? I uninstalled the MathJax for GH Chrome extension already, and the math expressions still don’t work, no beta feature for it is available yet. |
Beta Was this translation helpful? Give feedback.
FYI they just released LaTeX support (using MathJax) yesterday: Render mathematical expressions in Markdown | GitHub Changelog