Skip to content
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

mathjax with slideous does not update formulae #966

Closed
dimpase opened this issue Aug 30, 2013 · 4 comments
Closed

mathjax with slideous does not update formulae #966

dimpase opened this issue Aug 30, 2013 · 4 comments

Comments

@dimpase
Copy link

dimpase commented Aug 30, 2013

http://johnmacfarlane.net/pandoc/demo/example16d.html produced with

pandoc  -s --mathjax -i -t slideous SLIDES -o example16d.html

does not render the maths formula correctly even after reloads (true for stable and for the git versions of pandoc, I tried these locally). The following change in SLIDES source for the last page fixes this issue:

# Conclusion
<table>
    <script type="text/javascript">
        MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
    </script>
</table>
- And the answer is...
- $f(x)=\sum_{n=0}^\infty\frac{f^{(n)}(a)}{n!}(x-a)^n$    

I suppose this has to do with MathJax treating the pages as dynamic, and this is known to need a call to MathJax.Hub.Queue(). So a proper fix would insert these calls -- it seems that one such call on the last page suffices --to render all the mathjax maths in the document correctly.

@jgm
Copy link
Owner

jgm commented Sep 1, 2013

I've never noticed a problem with mathjax in slidy or revealjs. Can you confirm that this problem only affects slideous?

@dimpase
Copy link
Author

dimpase commented Sep 1, 2013

Indeed, it is OK with revealjs and other http://johnmacfarlane.net/pandoc/demo/example16[a-c].html, but not with
slideous (i.e. http://johnmacfarlane.net/pandoc/demo/example16d.html).

@jgm jgm closed this as completed in 8b0052b Sep 1, 2013
jgm pushed a commit that referenced this issue Oct 7, 2013
Closes #1012.  Reopens #966.  A better solution for #966 will just
affect slideous, not the other slide writers.
@jgm jgm reopened this Oct 7, 2013
@dashed
Copy link

dashed commented Oct 12, 2013

Just a proposal.

Since slideous replaces the body.html with its modified version of the original body.html, it would re-execute any javascript that may be within the scope of body.

Would you be able to just insert the following whenever slideous is chosen as an output? Perhaps inject within include-after?

<script type="text/javascript">
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
</script>

This would ensure that the typeset is forced right after slideous is finished processing.

@jgm
Copy link
Owner

jgm commented Oct 13, 2013

Actually it should be easy enough to insert it directly in the

<script> tag as before, but only when slideous output is selected. +++ Alberto Leal [Oct 12 13 05:17 ]: > Just a proposal. > > Since slideous replaces the `body.html` with its modified version of the original `body.html`, it would re-execute any javascript that may be within the scope of `body`. > > Would you be able to just insert the following whenever slideous is chosen as an output? Perhaps inject within `include-after`? > > ``` > <script type="text/javascript"> > MathJax.Hub.Queue(["Typeset",MathJax.Hub]); > </script>
This would ensure that the typeset is forced right after slideous is finished processing.

---
Reply to this email directly or view it on GitHub:
https://github.com/jgm/pandoc/issues/966#issuecomment-26196452

@jgm jgm closed this as completed in 2ae7f5e Oct 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants