mathjax-config.js 813 B

123456789101112131415161718192021
  1. window.MathJax = {
  2. CommonHTML: {linebreaks: {automatic: true}},
  3. tex2jax: {
  4. inlineMath: [['$', '$'], ['\\(', '\\)']],
  5. displayMath: [['$$', '$$'], ['\\[', '\\]']],
  6. processEscapes: false,
  7. skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'] // Remove `code` (required for inline math).
  8. },
  9. TeX: {noUndefined: {attributes: {mathcolor: 'red', mathbackground: '#FFEEEE', mathsize: '90%'}}},
  10. messageStyle: 'none'
  11. };
  12. MathJax.Hub.Queue(function() {
  13. // Fix inline math wrapped in <code> tags after MathJax finishes running.
  14. // This is a workaround to overcome a shortcoming of Blackfriday Markdown.
  15. // See discussion in Hugo Docs.
  16. let all = MathJax.Hub.getAllJax(), i;
  17. for (i = 0; i < all.length; i += 1) {
  18. all[i].SourceElement().parentNode.className += ' has-jax';
  19. }
  20. });