-
Notifications
You must be signed in to change notification settings - Fork 855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[liquid_tags] Inline math is not rendered with MathJax #933
Comments
Well, it is executed. The issue is mathjax JS is loaded with Looks like |
That's a little confusing for me... Should I have understood the solution from @avaris comment? |
@drorata Sorry if it turned out confusing. My suggestion is to remove <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script> so that it becomes: <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
|
See getpelican#933 for more details.
@drorata "any idea why" - sure, it's the exact snippet from the MathJax documentation. |
@isms But it broke my rendering. What is the best practice solution? |
@dorata the problem is that the MathJax configuration is pretty weird in general. It loads MathJax, then sets the configuration, and then re-renders the page -- that's pretty inefficient and breaks when loading MathJax asynchronously (as the function to configure and re-render will never hit the if check). It would be better to configure MathJax before it is loaded. I'm guessing the weird setup stems from the days when MathJax could not be configured easily in plain JS; that's no longer a problem, cf http://docs.mathjax.org/en/latest/configuration.html#using-plain-javascript |
See getpelican#933 (comment) for more details on the configuration of MathJax
@pkra First, nice surprise to meet here :) Secondly, would this attempt, drorata@d8b3ef2, address the problem correctly? @isms what do you think? |
Nice to run into you!
That looks good; I've added some comments. |
I have updated the attempt based on @pkra comment. See drorata@139eac6 @isms Any reservations? |
@drorata No reservations here. |
See: getpelican#933 and in particular getpelican#933 (comment) for more details. Use improved MathJax setting and maintaining the async loading. This closes getpelican#933
See: getpelican#933 and in particular getpelican#933 (comment) for more details. This commit replaced getpelican#935 Use improved MathJax setting and maintaining the async loading. This closes getpelican#933
See: getpelican#933 and in particular getpelican#933 (comment) for more details. This commit replaced getpelican#935 Use improved MathJax setting and maintaining the async loading. This closes getpelican#933
See: getpelican#933 and in particular getpelican#933 (comment) for more details. Use improved MathJax setting and maintaining the async loading. This closes getpelican#933
See: getpelican#933 and in particular getpelican#933 (comment) for more details. Use improved MathJax setting and maintaining the async loading. This closes getpelican#933 Fixed async loading of page breaking mathjax See getpelican#933 for more details.
I am up-to-date but I still see this behavior (http://localhost:8000/blog/2015/11/10/mcmc-sampling/). I also tried your branch |
I'm also up to date and see the same behavior (math works in notebook but not in webpage). I even tried deleting the |
@twiecki Have you looked up my blog's sources? Maybe you can compare and find out the difference. In this example I believe everything is rendered correctly. |
Hi, I am also having this problem. I tried recreating your blog on my local computer by cloning this. I also cloned your version of pelican-plugins. But it seems that on my computer, the inline maths do not render as expected. I am not sure why this is happening. Can you help? |
@yamalcaraz Are you sure you're using the same version of pelican? |
Yes, I am sure, I am using pelican 3.7.1. I also tried using your environment.yml, but still does not work... |
For some odd reason, even though I'm quite sure I am up-to-date on |
Hi @twiecki, I'm not sure which ipynb file you are talking about, I searched the |
Sorry, I meant |
Wow, the same thing worked for me! Doing a diff of my notebook.py file and @drorata's, the only non-whitespace difference was on what for me was line 180. I had
and @drorata had
When I changed Thanks! EDIT: |
@twiecki I see, but I think I am also using the one fixed by @drorata correctly. See image below, the "async" was removed from the line as in (drorata@d8b3ef2), so it is supposed to work, but still does not on my machine. Tell me if there are more details that I can provide that can help. Thanks! |
Ok, I found out about my problem, it seems that my problem was not about the I fixed it in my fork of Anyway thanks for the help! |
@yamalcaraz Please send a PR. |
Ok, this will be actually my first pull request. I hope it helps! |
liquid_tags
fails to render inline math for me. I managed to have inline math rendered properly when using "plain" markdown. See for example this example with sources available here.However, inline math in a Jupyter notebook is not rendered properly even though it does look OK inside the Jupyter environment. An example can be found in the following places:
As you can see, Github renders the inline math properly, but when included in a post, this breaks. I failed to understand where the problem is. Any help would be appreciated.
Update 1:
It seems like the function
init_mathjax()
is not executed when theHTML
page is loaded. If I run it manually from the page's console, the inline math is rendered properly.Update 2: I cross posted the issue also on SO
The text was updated successfully, but these errors were encountered: