## mako
## File:   templates/mathjax_include.html
##
## Advanced mathjax using 2.0-latest CDN for Dynamic Math
##
## This enables ASCIIMathJAX, and is used by js_textbox


%if mathjax_mode is not Undefined and mathjax_mode == 'wiki':
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {inlineMath: [ ['$','$'], ["\\(","\\)"]],
              displayMath: [ ['$$','$$'], ["\\[","\\]"]]}
  });
</script>
%else:
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    tex2jax: {
      inlineMath: [
        ["\\(","\\)"],
        ['[mathjaxinline]','[/mathjaxinline]']
      ],
      displayMath: [
        ["\\[","\\]"],
        ['[mathjax]','[/mathjax]']
      ]
    }
  });
</script>
%endif
<script type="text/x-mathjax-config">
  window.HUB = MathJax.Hub;
  MathJax.Hub.signal.Interest(function(message) {
    if(message[0] === "End Math") {
        set_mathjax_display_div_settings();
    }
  });
  function set_mathjax_display_div_settings() {
    $('.MathJax_Display').each(function( index ) {
      this.setAttribute('tabindex', '0');
      this.setAttribute('aria-live', 'off');
      this.removeAttribute('role');
      this.removeAttribute('aria-readonly');
    });
  }
</script>


<!-- This must appear after all mathjax-config blocks, so it is after the imports from the other templates.
     It can't be run through static.url because MathJax uses crazy url introspection to do lazy loading of
     MathJax extension libraries -->
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/2.4-latest/MathJax.js?config=TeX-MML-AM_HTMLorMML-full"></script>
