Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MathJax): Add support for MathJax extension, e.g. physics package #1663

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions _includes/js-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,6 @@
{% capture script %}{{ js_dist }}{{ js }}.min.js{% endcapture %}
<script defer src="{{ script | relative_url }}"></script>

{% if page.math %}
<!-- MathJax -->
<script>
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
MathJax = {
tex: {
/* start/end delimiter pairs for in-line math */
inlineMath: [
['$', '$'],
['\\(', '\\)']
],
/* start/end delimiter pairs for display math */
displayMath: [
['$$', '$$'],
['\\[', '\\]']
],
/* equation numbering */
tags: 'ams'
}
};
</script>
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
{% endif %}

<!-- Pageviews -->
{% if page.layout == 'post' %}
Expand Down
22 changes: 22 additions & 0 deletions _includes/mathjax-support.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script>
/* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
/* MathJax extensions can be found: <https://docs.mathjax.org/en/latest/input/tex/extensions/index.html> */
MathJax = {
tex: {
/* start/end delimiter pairs for in-line math */
inlineMath: [
['$', '$'],
['\\(', '\\)']
],
/* start/end delimiter pairs for display math */
displayMath: [
['$$', '$$'],
['\\[', '\\]']
],
/* equation numbering */
tags: 'ams'
}
};
</script>
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
5 changes: 5 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@

{% include js-selector.html lang=lang %}

<!-- MathJax -->
{% if page.math %}
{% include mathjax-support.html %}
{% endif %}

{% if page.mermaid %}
{% include mermaid.html %}
{% endif %}
Expand Down