mathjax_script.txt 1.7 KB

12345678910111213141516171819202122232425262728293031
  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 = 'https:' == document.location.protocol
  7. ? 'https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js'
  8. : 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML';
  9. mathjaxscript[(window.opera ? "innerHTML" : "text")] =
  10. "MathJax.Hub.Config({{" +
  11. " config: ['MMLorHTML.js']," +
  12. " TeX: {{ extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: {{ autoNumber: 'AMS' }} }}," +
  13. " jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
  14. " extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
  15. " displayAlign: '{align}'," +
  16. " displayIndent: '{indent}'," +
  17. " showMathMenu: {show_menu}," +
  18. " tex2jax: {{ " +
  19. " inlineMath: [ ['$','$'] ], " +
  20. " displayMath: [ ['$$','$$'] ]," +
  21. " processEscapes: {process_escapes}," +
  22. " preview: '{latex_preview}'," +
  23. " }}, " +
  24. " 'HTML-CSS': {{ " +
  25. " styles: {{ '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {{color: '{color} ! important'}} }}" +
  26. " }} " +
  27. "}}); ";
  28. (document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
  29. }}
  30. </script>