-
Hi, Is there a way to display Math from a markdown file on Github pages? (I know that it’s not possible for Github, but I would like to know if there’s an option to make it work for GH-Pages). I’ve done a lot of A link to the relevant topic would be much appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments
-
If you simply allow GitHub Pages to render your Markdown files into HTML without customizing the rendering yourself via something like Jekyll or another static site generator, then no. The default rendering of Markdown to HTML via GitHub Pages doesn’t include anything like MathJax for displaying formatted math formulae. If you use Jekyll (or another static site generator), then you could change the default template to include MathJax like I’ve done on my GitHub Pages website: github.comlee-dohm/lee-dohm.github.io/blob/77260089817da592b570b64a33f5642dca60a9b9/_layouts/base.html#L20-L23
I hope that helps! |
Beta Was this translation helpful? Give feedback.
-
I have no issues using Jekyll to generate my site (and then pushing the HTML). However, when I tried to use Jekyll, all I can see is the blogging feature. To be more specific, say, I have a Now, I want to use Jekyll to convert these markdown files to HTML (with math included). I don’t want to use any other feature of Jekyll (more specifically, I don’t need a So, how would I go about implementing this? I understand it’s not a domain of Github, but thanks in advance. (Or is it not possible to convert a set of already existing markdown files on Github to HTML via Jekyll)? |
Beta Was this translation helpful? Give feedback.
-
You can use Jekyll without the blog functionality. If you take a look at the repository for my website, you’ll notice that I have a mixture of blog and non-blog content in there. The blog functionality is there to optimize for the most common use of static site generators, blog-like structures. If you want to have just a bunch of pages that you manually control the structure of, you can do that by linking to where they’re going to be generated into position like I do here: github.comlee-dohm/lee-dohm.github.io/blob/77260089817da592b570b64a33f5642dca60a9b9/_layouts/base.html#L57-L61
|
Beta Was this translation helpful? Give feedback.
-
Thanks for the insights. I’ll take a look at your repo and (hopefully) setup my own. Have a good day! |
Beta Was this translation helpful? Give feedback.
-
Also, slightly off topic, but do you know a workaround for jumping from GH-Pages to Github? The rules for redirection are fairly simple, (as you just need to add |
Beta Was this translation helpful? Give feedback.
-
Just-A-Visitor:
You can control all kinds of things like this when you use Jekyll (or another static site generator). I know that my friend and coworker @benbalter has some elements that I have yet to Basically, if your question is some derivative of “can I customize pages on GitHub Pages to … ?”, the answer is invariably going to be “with a static site generator such as Jekyll, yes” 😀 But the reason why you probably haven’t seen a plugin specifically for doing exactly what you described is that there are many reasons for wanting to link back to GitHub from a page. The jekyll-github-metadata plugin allows you to implement any of them. |
Beta Was this translation helpful? Give feedback.
-
Right, I think I can take it from here. Thanks for the help! |
Beta Was this translation helpful? Give feedback.
-
A while ago I created xhub, a browser extension that allows you to use math in github pages. Cons:
Pros:
Perhaps worth checking out. |
Beta Was this translation helpful? Give feedback.
-
Very interesting and useful. The extension can also be used in Edge. However, the pages can not display the mathematics properly when the pages are built into web in Github. It only works on the original Github Markdown files. |
Beta Was this translation helpful? Give feedback.
-
What does it mean using a chrome extension to add math to github pages? Will all visitors be able to properly see my formulas?!? |
Beta Was this translation helpful? Give feedback.
You can control all kinds of things like this when you use Jekyll (or another static site generator). I know that my friend and coworker @benbalter has some elements that I have yet to
steallovingly copy from his website such as a link to view a page’s revision history or submit a pull request to improve the page with the help of the jekyll-github-metadata plugin:Basically, if your question is some derivative of “can I customize pages on GitHub Pages to … ?”, the answer is invariably going to be “with a static site generator such as Jekyll, yes” 😀
But the reas…