mathjax_script_template 1.3 KB

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