Interface KatexOptions

interface KatexOptions {
    colorIsTextColor?: boolean;
    displayMode?: boolean;
    errorColor?: string;
    fleqn?: boolean;
    globalGroup?: boolean;
    leqno?: boolean;
    macros?: any;
    maxExpand?: number;
    maxSize?: number;
    minRuleThickness?: number;
    output?: "html" | "mathml" | "htmlAndMathml";
    strict?: string | boolean | Function;
    throwOnError?: boolean;
    trust?: boolean | ((context) => boolean);
}

Properties

colorIsTextColor?: boolean

If true, \color will work like LaTeX's \textcolor and takes 2 arguments

If false, \color will work like LaTeX's \color and takes 1 argument

In both cases, \textcolor works as in LaTeX

Default

false
displayMode?: boolean

If true, math will be rendered in display mode (math in display style and center math on page)

If false, math will be rendered in inline mode

Default

false
errorColor?: string

A Color string given in format #XXX or #XXXXXX

fleqn?: boolean

If true, display math renders flush left with a 2em left margin, like \documentclass[fleqn] in LaTeX with the amsmath package.

Default

false
globalGroup?: boolean

Place KaTeX code in the global group.

Default

false
leqno?: boolean

If true, display math has \tags rendered on the left instead of the right, like \usepackage[leqno]{amsmath} in LaTeX.

Default

false
macros?: any

A collection of custom macros.

See src/macros.js for its usage

maxExpand?: number

Limit the number of macro expansions to specified number

If set to Infinity, marco expander will try to fully expand as in LaTex

Default

1000
maxSize?: number

All user-specified sizes will be caped to maxSize ems

If set to Infinity, users can make elements and space arbitrarily large

Default

Infinity
minRuleThickness?: number

Specifies 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.

output?: "html" | "mathml" | "htmlAndMathml"

Determines 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.

Default

'htmlAndMathml'
strict?: string | boolean | Function

If false or "ignore", allow features that make writing in LaTex convenient but not supported by LaTex

If true or "error", throw an error for such transgressions

If "warn", warn about behavior via console.warn

Default

"warn"
throwOnError?: boolean

If 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 color given by errorColor

Default

true
trust?: boolean | ((context) => boolean)

If false (do not trust input), prevent any commands that could enable adverse behavior, rendering them instead in errorColor.

If true (trust input), allow all such commands.

Type declaration

    • (context): boolean
    • Parameters

      • context: TrustContext

      Returns boolean

Default

false

Generated using TypeDoc