Skip to content

Commit

Permalink
Add support for Kramdown's math mode $$ ... $$.
Browse files Browse the repository at this point in the history
  • Loading branch information
Quuxplusone committed Nov 19, 2018
1 parent 3927a45 commit eaafdc9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
36 changes: 36 additions & 0 deletions _includes/mathjax.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: [
"MathMenu.js",
"MathZoom.js",
"AssistiveMML.js",
"a11y/accessibility-menu.js"
],
jax: ["input/TeX", "output/CommonHTML"],
TeX: {
extensions: [
"AMSmath.js",
"AMSsymbols.js",
"noErrors.js",
"noUndefined.js",
]
}
});
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
var TEX = MathJax.InputJax.TeX;
var COLS = function (W) {
var WW = [];
for (var i = 0, m = W.length; i < m; i++)
{WW[i] = TEX.Parse.prototype.Em(W[i])}
return WW.join(" ");
};
TEX.Definitions.Add({
environment: {
psmallmatrix: ['Array',null,'(',')','c',COLS([1/3]),".2em",'S',1],
}
});
});
</script>
<script type="text/javascript" async
src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js">
</script>
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ <h1 class="site-name"><a href="{{ site.baseurl }}/">{{ site.name | markdownify }

{% include analytics.html %}
{% include anchorjs.html %}
{% include mathjax.html %}
</body>
</html>

0 comments on commit eaafdc9

Please sign in to comment.