Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 7c5ee23

Browse files
committed
Fix: better math rendering for mchoice
1 parent 0a8c16e commit 7c5ee23

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

runestone/mchoice/js/mchoice.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,13 @@ export default class MultipleChoice extends RunestoneBase {
4949
this.createMCForm();
5050
this.addCaption("runestone");
5151
this.checkServer("mChoice", true);
52-
$(document).on("runestone:mathjax-ready", function () {
53-
this.queueMathJax(this.containerDiv);
54-
});
52+
let self = this;
53+
// https://docs.mathjax.org/en/latest/options/startup/startup.html
54+
// https://docs.mathjax.org/en/latest/web/configuration.html#startup-action
55+
// runestoneMathReady is defined in the preamble for all PTX authored books
56+
if (typeof runestoneMathready !== "undefined") {
57+
runestoneMathReady.then(() => self.queueMathJax(self.containerDiv));
58+
}
5559
}
5660

5761
/*====================================

0 commit comments

Comments
 (0)