Skip to content

Commit

Permalink
fix: Fix LaTeX rendering in docs (#124)
Browse files Browse the repository at this point in the history
* Fix LaTeX rendering

* Add comment with reference to MathJax config in mkdocs material docs
  • Loading branch information
dexter2206 authored Sep 25, 2024
1 parent e407474 commit 1976ae9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions docs/javascript/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
window.MathJax = {
tex: {
inlineMath: [["$", "$"]],
displayMath: [["$$", "$$"]],
processEscapes: true,
processEnvironments: true
},
}

document$.subscribe(() => {
MathJax.startup.output.clearCache()
MathJax.typesetClear()
MathJax.texReset()
MathJax.typesetPromise()
})
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,11 @@ markdown_extensions:
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences

extra_javascript:
# Configuration for MathJax adapted from the official docs:
# https://squidfunk.github.io/mkdocs-material/reference/math/#mathjax
- javascript/config.js
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
extra:
version:
provider: mike

0 comments on commit 1976ae9

Please sign in to comment.