Skip to content

Commit

Permalink
build(mkdocs): fix mathjax rendering (#380)
Browse files Browse the repository at this point in the history
* feat(mkdocs): fix mathjax rendering

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>

* apply same change to mkdocs.yaml with autoware.universe#3846 to avoid sync conflict

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>

---------

Signed-off-by: Mamoru Sobue <mamoru.sobue@tier4.jp>
  • Loading branch information
soblin authored May 27, 2023
1 parent 445a776 commit b99e78d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docs/assets/js/mathjax.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true,
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex",
},
};

document$.subscribe(() => {
MathJax.typesetPromise();
});
7 changes: 5 additions & 2 deletions mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ extra_css:
- https://use.fontawesome.com/releases/v5.15.4/css/all.css

extra_javascript:
- https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML
- assets/js/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

plugins:
- awesome-pages
Expand Down Expand Up @@ -75,7 +77,8 @@ markdown_extensions:
- plantuml_markdown:
server: http://www.plantuml.com/plantuml
format: svg
- pymdownx.arithmatex
- pymdownx.arithmatex:
generic: true
- pymdownx.details
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
Expand Down

0 comments on commit b99e78d

Please sign in to comment.