Browse Source

Improved integration of MathJax

See: https://github.com/getpelican/pelican-plugins/issues/933
and in particular https://github.com/getpelican/pelican-plugins/issues/933#issuecomment-327721786
for more details.

Use improved MathJax setting and maintaining the async loading. This closes #933

Fixed async loading of page breaking mathjax

See https://github.com/getpelican/pelican-plugins/issues/933
for more details.
Dror Atariah 6 years ago
parent
commit
53ca5b0fdf
1 changed files with 4 additions and 4 deletions
  1. 4 4
      liquid_tags/notebook.py

+ 4 - 4
liquid_tags/notebook.py

@@ -167,7 +167,7 @@ div.collapseheader {
 }
 </style>
 
-<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
+<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
 <script type="text/javascript">
 init_mathjax = function() {
     if (window.MathJax) {
@@ -177,16 +177,16 @@ init_mathjax = function() {
                 inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                 displayMath: [ ['$$','$$'], ["\\[","\\]"] ]
             },
-            displayAlign: 'left', // Change this to 'center' to center equations.
+            displayAlign: 'center', // Change this to 'center' to center equations.
             "HTML-CSS": {
                 styles: {'.MathJax_Display': {"margin": 0}}
             }
         });
         MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
     }
-}
-init_mathjax();
+  };
 </script>
+<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML"></script>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
 
 <script type="text/javascript">