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

fix: Fix LaTeX rendering in docs #124

Merged
merged 2 commits into from
Sep 25, 2024
Merged
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
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's a specific issue or SO question that we could add here as a reference on why this is needed, it would be helpful for future us.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just followed the official docs, I added a comment with a link.

# 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
Loading