Skip to content
Merged
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
62 changes: 31 additions & 31 deletions docs/authoring/math.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,6 @@ such as [LaTeX], [MathML], [AsciiMath], as well as various output formats like
HTML, SVG, MathML. To use MathJax within your project, add the following lines
to your configuration:

=== "`docs/javascripts/mathjax.js`"

``` js
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => { // (1)!
MathJax.startup.output.clearCache()
MathJax.typesetClear()
MathJax.texReset()
MathJax.typesetPromise()
})

component$.subscribe(({ ref }) => {
if (ref.classList.contains("md-annotation"))
MathJax.typesetPromise([ref])
})
```

1. This integrates MathJax with [instant navigation].

=== "`zensical.toml`"

``` toml
Expand All @@ -77,6 +46,37 @@ to your configuration:
- https://unpkg.com/mathjax@3/es5/tex-mml-chtml.js
```

And create the `docs/javascripts/mathjax.js` file:

``` js
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => { // (1)!
MathJax.startup.output.clearCache()
MathJax.typesetClear()
MathJax.texReset()
MathJax.typesetPromise()
})

component$.subscribe(({ ref }) => {
if (ref.classList.contains("md-annotation"))
MathJax.typesetPromise([ref])
})
```

1. This integrates MathJax with [instant navigation].

See additional configuration options:

- [Arithmatex]
Expand Down
Loading