Skip to content

Commit 716bc13

Browse files
committed
MathJax config & styles
1 parent 8d9cecd commit 716bc13

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

_ci/fingerprints.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ fingerprints=_data/fingerprints.yml
44

55
files=(
66
"icons:assets/img/icons/icons.svg"
7+
"maths:assets/js/maths.js"
78
"scripts:assets/js/scripts.js"
89
"search:assets/js/search.js"
910
"style:assets/css/style.css"

_includes/scripts.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
<script defer="defer" nonce="" src="{% include mainurl.html %}/assets/js/scripts.js{% include v.html id='scripts' %}"></script>
1212
{%- if page.maths -%}
13+
<style>
14+
mjx-help { display: none !important; }
15+
.mjx-selected { outline: none !important; }
16+
</style>
17+
<script defer="defer" nonce="" src="{% include mainurl.html %}/assets/js/maths.js{% include v.html id='maths' %}"></script>
1318
<script defer="defer" nonce="" src="https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js"></script>
1419
{%- endif -%}
1520
{%- if page.search -%}

assets/js/maths.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
window.MathJax = {
2+
options: {
3+
makeCollapsible: false,
4+
a11y: {
5+
help: false,
6+
backgroundOpacity: 0,
7+
},
8+
},
9+
startup: {
10+
ready() {
11+
const {SpeechExplorer} = MathJax._.a11y.explorer.KeyExplorer;
12+
SpeechExplorer.prototype.help = () => {};
13+
MathJax.startup.defaultReady();
14+
},
15+
},
16+
};

0 commit comments

Comments
 (0)