mathjax_script.txt 1.5 KB

1234567891011121314151617181920212223242526272829
  1. <script type= "text/javascript">
  2. if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {{
  3. var mathjaxscript = document.createElement('script');
  4. mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
  5. mathjaxscript.type = 'text/javascript';
  6. mathjaxscript.src = {source};
  7. mathjaxscript[(window.opera ? "innerHTML" : "text")] =
  8. "MathJax.Hub.Config({{" +
  9. " config: ['MMLorHTML.js']," +
  10. " TeX: {{ extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: {{ autoNumber: 'AMS' }} }}," +
  11. " jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
  12. " extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
  13. " displayAlign: '{align}'," +
  14. " displayIndent: '{indent}'," +
  15. " showMathMenu: {show_menu}," +
  16. " tex2jax: {{ " +
  17. " inlineMath: [ ['$','$'] ], " +
  18. " displayMath: [ ['$$','$$'] ]," +
  19. " processEscapes: {process_escapes}," +
  20. " preview: '{latex_preview}'," +
  21. " }}, " +
  22. " 'HTML-CSS': {{ " +
  23. " styles: {{ '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {{color: '{color} ! important'}} }}" +
  24. " }} " +
  25. "}}); ";
  26. (document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
  27. }}
  28. </script>