Skip to content

Commit

Permalink
Latex: add Katex to mkdocs (#148)
Browse files Browse the repository at this point in the history
* Latex: add Katex to mkdocs

* add EOF
  • Loading branch information
hugtalbot authored Aug 9, 2024
1 parent d7b468c commit aa0dc22
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
12 changes: 12 additions & 0 deletions javascripts/katex.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
document$.subscribe(({ body }) => {


renderMathInElement(body, {
delimiters: [
{ left: "$$", right: "$$", display: true },
{ left: "$", right: "$", display: true },
{ left: "\\(", right: "\\)", display: false },
{ left: "\\[", right: "\\]", display: false }
],
})
})
9 changes: 9 additions & 0 deletions mkdocs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,13 @@ markdown_extensions:
- pymdownx.superfences
- pymdownx.tabbed:
alternate_style: true
- pymdownx.arithmatex:
generic: true

extra_javascript:
- javascripts/katex.js
- https://unpkg.com/katex@0/dist/katex.min.js
- https://unpkg.com/katex@0/dist/contrib/auto-render.min.js

extra_css:
- https://unpkg.com/katex@0/dist/katex.min.css

0 comments on commit aa0dc22

Please sign in to comment.