pub struct KaTeXOptions {
    pub display_mode: bool,
    pub left_equation_numbers: bool,
    pub flush_left_equations: bool,
    pub throw_on_error: bool,
    pub min_rule_thickness: f64,
    pub max_size: f64,
    pub max_expand: i32,
    pub strict: bool,
    pub trust: bool,
    pub global_group: bool,
    /* private fields */
Expand description

Read https://katex.org/docs/options.html for more information.


display_mode: bool

Whether to render the math in the display mode.

left_equation_numbers: bool

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

flush_left_equations: bool

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

throw_on_error: bool

Whether to let KaTeX throw a ParseError for invalid LaTeX.

min_rule_thickness: f64

Color used for invalid LaTeX. Specifies a minimum thickness, in ems.

max_size: f64

Max size for user-specified sizes. If set to None, users can make elements and spaces arbitrarily large.

max_expand: i32

Limit the number of macro expansions to the specified number. If set to None, the macro expander will try to fully expand as in LaTeX.

strict: bool

strict mode

trust: bool

Whether to trust users’ input. Cannot be assigned at the same time with [OptsBuilder::trust_callback].

global_group: bool



Set output as \displaystyle

Set output as \inlinestyle

Render formulas to html string.

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. This is the default.

Set the color of the error message.

Insert a custom macro.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.