mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-10 13:38:39 +00:00
docs: minor documentation fixes (#2852)
Co-authored-by: ylemkimon <y@ylem.kim>
This commit is contained in:
@@ -37,7 +37,16 @@ For example:
|
|||||||
<script>
|
<script>
|
||||||
document.addEventListener("DOMContentLoaded", function() {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
renderMathInElement(document.body, {
|
renderMathInElement(document.body, {
|
||||||
// ...options...
|
// customised options
|
||||||
|
// • auto-render specific keys, e.g.:
|
||||||
|
delimiters: [
|
||||||
|
{left: '$$', right: '$$', display: true},
|
||||||
|
{left: '$', right: '$', display: false},
|
||||||
|
{left: '\\(', right: '\\)', display: false},
|
||||||
|
{left: '\\[', right: '\\]', display: true}
|
||||||
|
],
|
||||||
|
// • rendering keys, e.g.:
|
||||||
|
throwOnError : false
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -67,8 +76,8 @@ function renderMathInElement(elem, options)
|
|||||||
nodes inside this element and render the math in them.
|
nodes inside this element and render the math in them.
|
||||||
|
|
||||||
`options` is an optional object argument that can have the same keys as [the
|
`options` is an optional object argument that can have the same keys as [the
|
||||||
object passed to `katex.render`](https://github.com/KaTeX/KaTeX/#rendering-options),
|
object passed to `katex.render`](options.html),
|
||||||
in addition to two auto-render-specific keys:
|
in addition to five auto-render-specific keys:
|
||||||
|
|
||||||
- `delimiters`: This is a list of delimiters to look for math, processed in
|
- `delimiters`: This is a list of delimiters to look for math, processed in
|
||||||
the same order as the list. Each delimiter has three properties:
|
the same order as the list. Each delimiter has three properties:
|
||||||
|
@@ -29,7 +29,7 @@ You can provide an object of options as the last argument to [`katex.render` and
|
|||||||
LaTeX would thereby comment out the end of math mode (e.g. `$`),
|
LaTeX would thereby comment out the end of math mode (e.g. `$`),
|
||||||
causing an error.
|
causing an error.
|
||||||
- `"htmlExtension"`: Use of HTML extension (`\html`-prefixed) commands,
|
- `"htmlExtension"`: Use of HTML extension (`\html`-prefixed) commands,
|
||||||
which are provieded for HTML manipulation.
|
which are provided for HTML manipulation.
|
||||||
|
|
||||||
A second category of `errorCode`s never throw errors, but their strictness
|
A second category of `errorCode`s never throw errors, but their strictness
|
||||||
affects the behavior of KaTeX:
|
affects the behavior of KaTeX:
|
||||||
|
@@ -339,7 +339,9 @@ Macros can also be defined in the KaTeX [rendering options](options.md).
|
|||||||
|
|
||||||
Macros accept up to nine arguments: #1, #2, etc.
|
Macros accept up to nine arguments: #1, #2, etc.
|
||||||
|
|
||||||
<div id="gdef"></div>
|
</div>
|
||||||
|
|
||||||
|
<div id="gdef">
|
||||||
|
|
||||||
Macros defined by `\gdef`, `\xdef`, `\global\def`, `\global\edef`, `\global\let`, and `\global\futurelet` will persist between math expressions. (Exception: macro persistence may be disabled. There are legitimate security reasons for that.)
|
Macros defined by `\gdef`, `\xdef`, `\global\def`, `\global\edef`, `\global\let`, and `\global\futurelet` will persist between math expressions. (Exception: macro persistence may be disabled. There are legitimate security reasons for that.)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user