Struct katex_wasmbind::KaTeXOptions
source · [−]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.
Fields
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
group
Implementations
sourceimpl KaTeXOptions
impl KaTeXOptions
pub fn display_mode() -> KaTeXOptions
pub fn inline_mode() -> KaTeXOptions
pub fn render(&self, input: &str) -> String
sourceimpl KaTeXOptions
impl KaTeXOptions
sourcepub fn set_output_format(&mut self, format: &str) -> bool
pub fn set_output_format(&mut self, format: &str) -> bool
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.
pub fn set_error_color(&mut self) -> bool
pub fn set_macro_rules(&mut self) -> bool
pub fn insert_macro_rule(&mut self) -> bool
Trait Implementations
sourceimpl Clone for KaTeXOptions
impl Clone for KaTeXOptions
sourcefn clone(&self) -> KaTeXOptions
fn clone(&self) -> KaTeXOptions
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for KaTeXOptions
impl Default for KaTeXOptions
sourceimpl<'de> Deserialize<'de> for KaTeXOptions
impl<'de> Deserialize<'de> for KaTeXOptions
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl From<KaTeXOptions> for JsValue
impl From<KaTeXOptions> for JsValue
sourcefn from(value: KaTeXOptions) -> Self
fn from(value: KaTeXOptions) -> Self
Performs the conversion.
sourceimpl FromWasmAbi for KaTeXOptions
impl FromWasmAbi for KaTeXOptions
sourceimpl IntoWasmAbi for KaTeXOptions
impl IntoWasmAbi for KaTeXOptions
sourceimpl OptionFromWasmAbi for KaTeXOptions
impl OptionFromWasmAbi for KaTeXOptions
sourceimpl OptionIntoWasmAbi for KaTeXOptions
impl OptionIntoWasmAbi for KaTeXOptions
sourceimpl RefFromWasmAbi for KaTeXOptions
impl RefFromWasmAbi for KaTeXOptions
type Anchor = Ref<'static, KaTeXOptions>
type Anchor = Ref<'static, KaTeXOptions>
The type that holds the reference to Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous. Read more
sourceunsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_from_abi(js: Self::Abi) -> Self::Anchor
Recover a Self::Anchor
from Self::Abi
. Read more
sourceimpl RefMutFromWasmAbi for KaTeXOptions
impl RefMutFromWasmAbi for KaTeXOptions
type Anchor = RefMut<'static, KaTeXOptions>
type Anchor = RefMut<'static, KaTeXOptions>
Same as RefFromWasmAbi::Anchor
sourceunsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
Same as RefFromWasmAbi::ref_from_abi
sourceimpl Serialize for KaTeXOptions
impl Serialize for KaTeXOptions
sourceimpl WasmDescribe for KaTeXOptions
impl WasmDescribe for KaTeXOptions
Auto Trait Implementations
impl RefUnwindSafe for KaTeXOptions
impl Send for KaTeXOptions
impl Sync for KaTeXOptions
impl Unpin for KaTeXOptions
impl UnwindSafe for KaTeXOptions
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for T where
T: IntoWasmAbi,
type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as IntoWasmAbi::Abi
sourcefn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more