pmq20 / mathjax-rails

Simple gem to integrate MathJax with Rails and maintains MathJax at a system-wide directory.
MIT License
66 stars 30 forks source link

Rendering only after page refresh #18

Open mametz opened 9 years ago

mametz commented 9 years ago

The Mathjax code is rendered only after I refresh the page. What could be the issue?

mametz commented 8 years ago

An example of this beahviour can be seen here: http://drosophila.me/c62393ee6a96f1dfd1ebb72782515ae2

mametz commented 8 years ago

I've solved this by adding the following at the end of the file:

<script type="text/javascript">
if (window.MathJax) {
  MathJax.Hub.Queue(
    ["Typeset",MathJax.Hub]
  );
}
</script>
iainbryson commented 8 years ago

+1

piga commented 7 years ago

What does this script do? Please explain. Thanks

piga commented 7 years ago

OK, I found explanation on https://docs.mathjax.org/en/v1.0/typeset.html