-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9e1c0a9
commit bdd79b2
Showing
7 changed files
with
65 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% assign math = page.math | default: layout.math | default: site.math %} | ||
|
||
{% case math %} | ||
{% when "mathjax" %} | ||
{% include mathjax.html %} | ||
{% endcase %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!-- Automatically display code inside script tags with type=math/tex using MathJax --> | ||
<script type="text/javascript" defer | ||
src="/just-the-docs-tests/assets/js/mathjax-script-type.js"> | ||
</script> | ||
|
||
<!-- Copied from https://docs.mathjax.org/en/latest/web/components/combined.html --> | ||
<script type="text/javascript" id="MathJax-script" defer | ||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-svg.js"> | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
layout: default | ||
math: mathjax | ||
--- | ||
<div style="display: none"> | ||
\( | ||
<!-- optional definitions using \newcommand, etc. | ||
see https://docs.mathjax.org/en/latest/input/tex/macros.html --> | ||
\) | ||
</div> | ||
|
||
{{ content }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copied from https://docs.mathjax.org/en/latest/upgrading/v2.html#changes-in-the-mathjax-api | ||
MathJax = { | ||
options: { | ||
renderActions: { | ||
findScript: [10, function (doc) { | ||
for (const node of document.querySelectorAll('script[type^="math/tex"]')) { | ||
const display = !!node.type.match(/; *mode=display/); | ||
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display); | ||
const text = document.createTextNode(''); | ||
node.parentNode.replaceChild(text, node); | ||
math.start = {node: text, delim: '', n: 0}; | ||
math.end = {node: text, delim: '', n: 0}; | ||
doc.math.push(math); | ||
} | ||
}, ''] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters