mathjax.html.j2 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. {%- macro mathjax(url="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS_CHTML-full,Safe") -%}
  2. <!-- Load mathjax -->
  3. <script src="{{url}}"> </script>
  4. <!-- MathJax configuration -->
  5. <script type="text/x-mathjax-config">
  6. init_mathjax = function() {
  7. if (window.MathJax) {
  8. // MathJax loaded
  9. MathJax.Hub.Config({
  10. TeX: {
  11. equationNumbers: {
  12. autoNumber: "AMS",
  13. useLabelIds: true
  14. }
  15. },
  16. tex2jax: {
  17. inlineMath: [ ['$','$'], ["\\(","\\)"] ],
  18. displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
  19. processEscapes: true,
  20. processEnvironments: true
  21. },
  22. displayAlign: 'center',
  23. messageStyle: 'none',
  24. CommonHTML: {
  25. linebreaks: {
  26. automatic: true
  27. }
  28. }
  29. });
  30. MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
  31. }
  32. }
  33. init_mathjax();
  34. </script>
  35. <!-- End of mathjax configuration -->
  36. {%- endmacro %}