Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I managed to get KaTeX to render in Gitbooks: https://github.com/SamLau95/plugin-katex
This fixes the mathjax initialization issue in a non-hacky way (no appending to the DOM, etc):
However, as the GIF above shows this breaks usages of
\mbox
. It looks like mbox isn't recommended (https://tex.stackexchange.com/questions/146909/what-does-mbox-do) and when I replace\mbox
with\text
the math renders just fine:Another change is that the
align*
environment needs to be wrapped in$$
and replaced withaligned
(this also renders in a notebook correctly). After doing that, math like this renders fine:One perhaps easier thing to do is to just find and replace across all the notebooks for usage of
\mbox
and thealign*
environment during the notebook conversion step. What do you think?