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

How to add mathjax to index.html #10

Closed
zmonoid opened this issue Sep 13, 2017 · 7 comments
Closed

How to add mathjax to index.html #10

zmonoid opened this issue Sep 13, 2017 · 7 comments

Comments

@zmonoid
Copy link

zmonoid commented Sep 13, 2017

as titled.

@zmonoid
Copy link
Author

zmonoid commented Sep 13, 2017

I have tried to add the following code to index.html inside body block. However it does not work.

    <script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML&delayStartupUntil=configured" type="text/javascript"></script>
    <script>
      var slideshow = remark.create();

      MathJax.Hub.Config({
          tex2jax: {
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
          }

      });
      MathJax.Hub.Queue(function() {
          $(MathJax.Hub.getAllJax()).map(function(index, elem) {
              return(elem.SourceElement());
          }).parent().addClass('has-jax');
      });
      MathJax.Hub.Configured();
    </script>
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {inlineMath: [["$","$"],["\\(","\\)"],["\[","\]"]]},
      });
    </script>

@sinedied
Copy link
Owner

See #5

@zmonoid
Copy link
Author

zmonoid commented Sep 13, 2017

Thanks very much.

The problem is that rendering MathJax is really slow than directly using remarkjs

@zmonoid
Copy link
Author

zmonoid commented Sep 13, 2017

It seems the math will be rendered randomly...

Sometime it even does not work!

@sinedied
Copy link
Owner

sinedied commented Sep 13, 2017

Not really a backslide related issue then. It's maybe your network, since MathJax loads a bunch of files, is quite heavy and cannot be inlined to work offline.

You should try KaTeX.

@zmonoid
Copy link
Author

zmonoid commented Sep 15, 2017

Thanks very much. KaTex is much faster indeed.
I am currently facing problem with both mathjax and katex, which should be a problem of remarkjs, and I reported here:

gnab/remark#464

@sinedied
Copy link
Owner

I'll close the issue then, thanks for the feedback.

@sinedied sinedied mentioned this issue Apr 24, 2018
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

2 participants