From 603e299c281c1dcc223c02af83d47c4e7004dd86 Mon Sep 17 00:00:00 2001 From: Tsukamoto <49139020+TsuMakoto@users.noreply.github.com> Date: Sat, 11 Jul 2020 02:24:09 +0900 Subject: [PATCH] Add Documentation for using single-dollar symbol for the KaTex (#2269) * Add Documentation for using single-dollar symbol for the Katex * xfi Katex to KaTex * Revision pass and move to delimiters bullet * Fix indentation, remove blank line Co-authored-by: Erik Demaine Co-authored-by: Ron Kok --- docs/autorender.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/autorender.md b/docs/autorender.md index 83d6bf5d..587ebb47 100644 --- a/docs/autorender.md +++ b/docs/autorender.md @@ -70,8 +70,8 @@ nodes inside this element and render the math in them. object passed to `katex.render`](https://github.com/KaTeX/KaTeX/#rendering-options), in addition to two auto-render-specific keys: -- `delimiters`: This is a list of delimiters to look for math. Each delimiter - has three properties: +- `delimiters`: This is a list of delimiters to look for math, processed in + the same order as the list. Each delimiter has three properties: - `left`: A string which starts the math expression (i.e. the left delimiter). - `right`: A string which ends the math expression (i.e. the right delimiter). @@ -88,6 +88,19 @@ in addition to two auto-render-specific keys: ] ``` + If you want to add support for inline math via `$...$`, be sure to list it + *after* `$$`, as in the following. (Because rules are processed in order, + putting a `$` rule first would catch `$$` as an empty math expression.) + + ```js + [ + {left: "$$", right: "$$", display: true}, + {left: "$", right: "$", display: false}, + {left: "\\(", right: "\\)", display: false}, + {left: "\\[", right: "\\]", display: true} + ] + ``` + - `ignoredTags`: This is a list of DOM node types to ignore when recursing through. The default value is `["script", "noscript", "style", "textarea", "pre", "code", "option"]`.