datitran / jupyter2slides

Cloud Native Presentation Slides with Jupyter Notebook + Reveal.js
MIT License
794 stars 176 forks source link

Latex rendering not working #3

Open marpat opened 7 years ago

marpat commented 7 years ago

Tried one cell as Markdown type and cannot get the Latex rendered. Works with RISE. How to fix it?

example:

Testing Mathjax

$\large{C_x = x^2 + \frac{a^3}{2b - c}}$

karelin commented 7 years ago

For some reason, the author removed initialization of MathJax library from the template.

In my case, adding

{{ mathjax() }}

to static/jupyter_template.tpl file after <!--[if lt IE 9]> ... <![endif]--> part helps.

In general, the jupyter2slides project looks like a collection of hacks over nbconvert utility and not all of the hacks working properly.

WI-KIWI commented 6 years ago

Hi karelin, thanks for the tipp, after adding the

{{ mathjax() }}

I got doubled tex-output in html, the first one is in the right Position, and the second one is in the next line. I think it's still a little bit Buggy for html Output with Latex formula.

ghost commented 6 years ago

If you use this template, it works: https://github.com/jupyter/nbconvert/blob/master/nbconvert/templates/html/slides_reveal.tpl

instead of the original jupyter_template.tpl

ghost commented 6 years ago

replace the lines below to keep the same theme:

ezmiller commented 6 years ago

Also having this problem.

AliDashti commented 6 years ago

Hi karelin, thanks for the tipp, after adding the

{{ mathjax() }}

I got doubled tex-output in html, the first one is in the right Position, and the second one is in the next line. I think it's still a little bit Buggy for html Output with Latex formula.

I remove the following few lines from jupyter_template.tpl and the double rendering went away:

    var update = function(event){
      if(MathJax.Hub.getAllJax(Reveal.getCurrentSlide())){
        MathJax.Hub.Rerender(Reveal.getCurrentSlide());
      }
    };