Struct katex::opts::OptsBuilder[][src]

pub struct OptsBuilder { /* fields omitted */ }
Expand description

Builder for Opts.

Implementations

impl OptsBuilder[src]

pub fn display_mode<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self[src]

Whether to render the math in the display mode.

pub fn output_type<VALUE: Into<OutputType>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

KaTeX output type.

pub fn leqno<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self[src]

Whether to have \tags rendered on the left instead of the right.

pub fn fleqn<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self[src]

Whether to make display math flush left.

pub fn throw_on_error<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self[src]

Whether to let KaTeX throw a ParseError for invalid LaTeX.

pub fn error_color<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self[src]

Color used for invalid LaTeX.

pub fn macros<VALUE: Into<HashMap<String, String>>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

Collection of custom macros. Read https://katex.org/docs/options.html for more information.

pub fn min_rule_thickness<VALUE: Into<f64>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

Specifies a minimum thickness, in ems. Read https://katex.org/docs/options.html for more information.

pub fn max_size<VALUE: Into<Option<f64>>>(&mut self, value: VALUE) -> &mut Self[src]

Max size for user-specified sizes. If set to None, users can make elements and spaces arbitrarily large. Read https://katex.org/docs/options.html for more information.

pub fn max_expand<VALUE: Into<Option<i32>>>(
    &mut self,
    value: VALUE
) -> &mut Self
[src]

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. Read https://katex.org/docs/options.html for more information.

pub fn trust<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self[src]

Whether to trust users’ input. Read https://katex.org/docs/options.html for more information.

pub fn build(&self) -> Result<Opts, OptsBuilderError>[src]

Builds a new Opts.

Errors

If a required field has not been initialized.

impl OptsBuilder[src]

pub fn add_macro(self, entry_name: String, entry_data: String) -> Self[src]

Add an entry to macros.

Examples

let opts = katex::Opts::builder()
    .add_macro(r#"\RR"#.to_owned(), r#"\mathbb{R}"#.to_owned())
    .build()
    .unwrap();
let html = katex::render_with_opts(r#"\RR"#, &opts).unwrap();

Trait Implementations

impl Clone for OptsBuilder[src]

fn clone(&self) -> OptsBuilder[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Default for OptsBuilder[src]

fn default() -> Self[src]

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

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.