Skip to content

Commit acc99af

Browse files
committedSep 18, 2016
Fix mathjax helper in material-theme
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 70c6c50 commit acc99af

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed
 

‎v7/material-theme/templates/post_helper.tmpl

+26-3
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,31 @@
8686

8787
{% macro mathjax_script(post) %}
8888
{% if post.is_mathjax %}
89-
<script type="text/x-mathjax-config">
90-
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});</script>
91-
<script src="/assets/js/mathjax.js"></script>
89+
{% if use_katex %}
90+
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js"></script>
91+
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/contrib/auto-render.min.js"></script>
92+
{% if katex_auto_render %}
93+
<script>
94+
renderMathInElement(document.body,
95+
{
96+
{{ katex_auto_render }}
97+
}
98+
);
99+
</script>
100+
{% else %}
101+
<script>
102+
renderMathInElement(document.body);
103+
</script>
104+
{% endif %}
105+
{% else %}
106+
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script>
107+
{% if mathjax_config %}
108+
{{ mathjax_config }}
109+
{% else %}
110+
<script type="text/x-mathjax-config">
111+
MathJax.Hub.Config({tex2jax: {inlineMath: [['$latex ','$'], ['\\(','\\)']]}});
112+
</script>
113+
{% endif %}
114+
{% endif %}
92115
{% endif %}
93116
{% endmacro %}

0 commit comments

Comments
 (0)
Please sign in to comment.