so-simple-theme icon indicating copy to clipboard operation
so-simple-theme copied to clipboard

Fixing MathJax rendering

Open danielphil opened this issue 3 years ago • 5 comments

This is a bug fix.

Summary

MathJax isn't rendering properly on the sample page or on my blog. I think this may be related to a Kramdown update on Github pages that's causing the problem.

It looks like there's a workaround in scripts.html that's no longer required, so I've just removed this.

I've tested this locally on the example pages and it fixes the rendering problem.

Context

I think this is also related to #388.

danielphil avatar Nov 01 '20 20:11 danielphil

Looks to me this broke MathJax rendering with Jekyll 4. That's probably what the original fix was for perhaps. I'm not close enough to MathJax to know what the path forward is, but seems to me the version of Kramdown used on GitHub Pages and current Jekyll 4.x are different and whatever "fix" there is needs to support both.

It actually looks worse off than the GitHub pages version as all of the math equations are removed instead of not rendering like before.

Screen Shot 2020-11-02 at 9 45 14 AM

mmistakes avatar Nov 02 '20 14:11 mmistakes

Oh! That's not good! I followed the development instructions to get a preview locally (looking at http://127.0.0.1:4000/example/2015/08/10/mathjax-example.html) and everything looked fine when I tested it there, but I might have missed something. I've tried a completely clean repo and repeating the test steps again and it's still rendering the equations for me.

I'm not very familiar with Ruby so I might be doing something wrong here, but my Gemfile.lock has jekyll (4.1.1), so I think I'm running with Jekyll 4? How're you setting up your test environment?

danielphil avatar Nov 03 '20 23:11 danielphil

Sounds like you previewed it locally the same way I did. When I cd into the /example/ folder and run bundle update it updated my version of Jekyll to the same one you're using 4.1.1. Previously I was at 4.0 which must have been the issue.

Now I'm seeing the math equations in the sample post as expected. Going to do some more testing before merging this in, but I think we're good now. As long as it works with the GitHub Pages flavor of Jekyll and latest I'm cool.

mmistakes avatar Nov 05 '20 15:11 mmistakes

Sounds good! Let me know if there's anything I can do to help with testing or if you run into any problems. Thanks for the fantastic theme!

danielphil avatar Nov 07 '20 21:11 danielphil

Hi @mmistakes! I just spotted the same issue on my blog and am on jekyll 3.9.3. Any suggestions on how to fix it?

indradhanush avatar Feb 06 '24 13:02 indradhanush