OptionalcolorIn early versions of both KaTeX (<0.8.0) and MathJax, the \color
function expected the content to be a function argument, as in
\color{blue}{hello}. In current KaTeX, \color is a switch, as in
\color{blue} hello. This matches LaTeX behavior. If you want the old
\color behavior, set option colorIsTextColor to true.
OptionaldisplayIf true the math will be rendered in display mode.
If false the math will be rendered in inline mode.
OptionalerrorA color string given in the format "#XXX" or "#XXXXXX". This option
determines the color that unsupported commands and invalid LaTeX are
rendered in when throwOnError is set to false.
OptionalfleqnIf true, display math renders flush left with a 2em left margin,
like \documentclass[fleqn] in LaTeX with the amsmath package.
OptionalglobalRun KaTeX code in the global group. As a consequence, macros defined at
the top level by \def and \newcommand are added to the macros
argument and can be used in subsequent render calls. In LaTeX,
constructs such as \begin{equation} and $$ create a local group and
prevent definitions other than \gdef from becoming visible outside of
those blocks, so this is KaTeX's default behavior.
OptionalleqnoIf true, display math has \tags rendered on the left instead of the
right, like \usepackage[leqno]{amsmath} in LaTeX.
OptionalmacrosA collection of custom macros.
OptionalmaxLimit the number of macro expansions to the specified number, to prevent
e.g. infinite macro loops. \edef expansion counts all expanded tokens.
If set to Infinity, the macro expander will try to fully expand as in
LaTeX.
OptionalmaxAll user-specified sizes, e.g. in \rule{500em}{500em}, will be capped
to maxSize ems. If set to Infinity (the default), users can make
elements and spaces arbitrarily large.
OptionalminSpecifies a minimum thickness, in ems, for fraction lines, \sqrt top
lines, {array} vertical lines, \hline, \hdashline, \underline,
\overline, and the borders of \fbox, \boxed, and \fcolorbox.
The usual value for these items is 0.04, so for minRuleThickness
to be effective it should probably take a value slightly above 0.04,
say 0.05 or 0.06. Negative values will be ignored.
OptionaloutputDetermines the markup language of the output. The valid choices are:
html: Outputs KaTeX in HTML only.mathml: Outputs KaTeX in MathML only.htmlAndMathml: Outputs HTML for visual rendering and includes MathML
for accessibility.OptionalstrictIf false or "ignore", allow features that make writing LaTeX
convenient but are not actually supported by (Xe)LaTeX
(similar to MathJax).
If true or "error" (LaTeX faithfulness mode), throw an error for any
such transgressions.
If "warn" (the default), warn about such behavior via console.warn.
Provide a custom function handler(errorCode, errorMsg, token) to
customize behavior depending on the type of transgression (summarized by
the string code errorCode and detailed in errorMsg); this function
can also return "ignore", "error", or "warn" to use a built-in
behavior.
OptionalthrowIf true, KaTeX will throw a ParseError when it encounters an
unsupported command or invalid LaTeX.
If false, KaTeX will render unsupported commands as text, and render
invalid LaTeX as its source code with hover text giving the error, in
the color given by errorColor.
OptionaltrustIf false (do not trust input), prevent any commands like
\includegraphics that could enable adverse behavior, rendering them
instead in errorColor.
If true (trust input), allow all such commands.
Provide a custom function handler(context) to customize behavior
depending on the context (command, arguments e.g. a URL, etc.).
Options for
katex.renderandkatex.renderToString.See
https://katex.org/docs/options