Skip to content

Commit

Permalink
Use inline script tag for custom LaTeX commands. (#4512)
Browse files Browse the repository at this point in the history
Previoulsy, we load MathJax and mathconfig.js asynchronously. This is
not good for mathconfig.js because it requires the main variable for
MathJax.js.
  • Loading branch information
p16i committed Feb 5, 2019
1 parent f5c6976 commit 4413403
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 0 additions & 8 deletions doc/cookbook/source/static/mathconf.js

This file was deleted.

1 change: 0 additions & 1 deletion doc/cookbook/source/templates/layout.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{% extends "!layout.html" %}
{% set script_files = script_files + ["_static/mathconf.js"] %}

{% set bootswatch_css_custom = ['_static/shogun-style.css'] %}
{#
Expand Down
11 changes: 11 additions & 0 deletions doc/cookbook/source/templates/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@
});
</script>

<script type="text/x-mathjax-config">
MathJax.Hub.Config({
TeX: {
Macros: {
argmax: ["\\mathop{\\rm arg\\,max}\\limits"],
argmin: ["\\mathop{\\rm arg\\,min}\\limits"]
}
}
});
</script>

{% else %}
{{ body }}
{% endif %}
Expand Down

0 comments on commit 4413403

Please sign in to comment.