Skip to content

MathJax plugin #531

Closed
hakimel opened this Issue Jul 19, 2013 · 10 comments

3 participants

@hakimel
Owner
hakimel commented Jul 19, 2013

Seems like quite a few people are using MathJax in their presentations. Let's add a plugin which includes MathJax and automatically parses/renders after the visibility of slides or fragments change.

@pkra
pkra commented Jul 23, 2013

Let us know if we (the MathJax team) can help with anything.

@hakimel
Owner
hakimel commented Jul 24, 2013

Thanks @pkra, will do.

@hakimel hakimel added a commit that referenced this issue Aug 12, 2013
@hakimel additional math examples #531 a6af097
@hakimel hakimel added a commit that referenced this issue Aug 13, 2013
@hakimel comments and failesafes for #531 3901904
@hakimel hakimel added a commit that referenced this issue Aug 13, 2013
@hakimel mathjax plugin updates #531 b17e285
@hakimel
Owner
hakimel commented Aug 18, 2013

A 1.0 implementation of this has been added to the dev branch, covered here: https://github.com/hakimel/reveal.js/blob/dev/README.md#mathjax

@hakimel hakimel closed this Aug 18, 2013
@pkra
pkra commented Aug 19, 2013

Very cool -- thanks for this!

@dashed dashed referenced this issue in jgm/pandoc Oct 4, 2013
Closed

Redundant MathJax script #1012

@stevenio

I am trying to use a local copy of MathJax in reveal.js. Could you show me an example on how set it up? Thanks!

@pkra
pkra commented Nov 18, 2013

Just follow the Readme at https://github.com/hakimel/reveal.js/blob/dev/README.md#mathjax and replace the link MathJax.js with your local copy. Watch out for webfonts CORS issues on Firefox, see http://docs.mathjax.org/en/latest/installation.html#firefox-and-local-fonts

You might also want to slim down MathJax, see https://github.com/mathjax/MathJax-docs/wiki/Guide%3A-reducing-size-of-a-mathjax-installation

@stevenio

Thank you for your quick response. I modified my path to MathJax, but it did not work. Chrome simply displayed all the text I have in the html, not symbols. If I use MathJax's URL, then everything works.
Results with my local MathJax:
screen

Here are my scripts:
<section>


<!-- from: http://docs.mathjax.org/en/latest/start.html -->
When $a \ne 0$, there are two solutions to (ax^2 + bx + c = 0) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

</section>

Here are the specifications for reveal.js:

    math: {
        // mathjax: 'http://cdn.mathjax.org/mathjax/latest/MathJax.js',
        mathjax: '/home/steven/Github/MathJax/MathJax.js',
        config: 'TeX-AMS_HTML-full'  // See http://docs.mathjax.org/en/latest/config-files.html
    }, 

   dependencies: [
      { src: 'plugin/notes/notes.js', async: true, condition: function () { return !!document.body.classList; } },
      { src: 'plugin/math/math.js', async: true }
    ]
});
@pkra
pkra commented Nov 18, 2013

It works for me. Are you getting any errors in the javascript console?

@stevenio

Thanks to your tip on checking javascript console of chrome, I figured out where the bug was. It turns out that the browser prepended "http://127.0.0.1:8000" to my path, i.e., " http://127.0.0.1:8000/home/steven/Github/MathJax/MathJax.js", which resulted in a 404 error. The bug fix is to copy MathJax folder to where my index.html is and change the reveal.js. specification to the following and everything works again.

    math: {
        mathjax: 'MathJax/MathJax.js',
        config: 'TeX-AMS_HTML-full'  
    }, 

Thanks a million for your help!

@pkra
pkra commented Nov 18, 2013

Glad to hear you could resolve it.

@andreabedini andreabedini referenced this issue in asciidoctor/asciidoctor-reveal.js Nov 13, 2014
Closed

math plugin #4

@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel first version of mathjax plugin #531 181c657
@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel additional math examples #531 014863d
@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel limit scope of mathjax rerender #531 a7f032c
@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel updates to mathjax plugin, incl more examples #531 7a83e65
@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel comments and failesafes for #531 5690c02
@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel make mathjax host a config option, revamp script loading, fragment ex…
…amples #531
9b0b7f2
@enovajuan enovajuan pushed a commit to enovajuan/reveal.js that referenced this issue Dec 2, 2014
@hakimel mathjax plugin updates #531 cf9e4a2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.