Skip to main content

MathPrimitiveOptions

Struct MathPrimitiveOptions 

Source
pub struct MathPrimitiveOptions {
Show 40 fields pub bounded: bool, pub mode: Option<String>, pub before_digest: Vec<BeforeDigestClosure>, pub after_digest: Vec<DigestionClosure>, pub before_construct: Vec<ConstructionClosure>, pub after_construct: Vec<ConstructionClosure>, pub is_prefix: bool, pub scope: Option<Scope>, pub font: Option<FontDirective>, pub require_math: bool, pub forbid_math: bool, pub locked: bool, pub alias: Option<String>, pub decl_id: Option<String>, pub replace: Option<String>, pub protected: bool, pub robust: bool, pub name: Option<String>, pub meaning: Option<String>, pub omcd: Option<String>, pub reversion: Option<Reversion>, pub sizer: Option<SizingClosure>, pub role: Option<String>, pub operator_role: Option<String>, pub reorder: bool, pub dual: bool, pub mathstyle: Option<String>, pub variablesize_op: bool, pub scriptpos: Option<String>, pub dynamic_scriptpos: bool, pub operator_scriptpos: Option<usize>, pub stretchy: Option<bool>, pub operator_stretchy: Option<bool>, pub nogroup: bool, pub hide_content_reversion: bool, pub revert_as: Option<Cow<'static, str>>, pub lpadding: Option<usize>, pub rpadding: Option<usize>, pub letters_class: Option<LettersClass>, pub absorb_warning: Option<Stored>,
}

Fields§

§bounded: bool§mode: Option<String>§before_digest: Vec<BeforeDigestClosure>§after_digest: Vec<DigestionClosure>§before_construct: Vec<ConstructionClosure>§after_construct: Vec<ConstructionClosure>§is_prefix: bool§scope: Option<Scope>§font: Option<FontDirective>§require_math: bool§forbid_math: bool§locked: bool§alias: Option<String>§decl_id: Option<String>§replace: Option<String>§protected: bool§robust: bool§name: Option<String>§meaning: Option<String>§omcd: Option<String>§reversion: Option<Reversion>§sizer: Option<SizingClosure>§role: Option<String>§operator_role: Option<String>§reorder: bool§dual: bool§mathstyle: Option<String>§variablesize_op: bool

A variable-size operator: Perl’s mathstyle => \&doVariablesizeOp (TeX_Math.pool.ltxml:353) — the mathstyle is computed at construction from the current style (display in display style, else text) instead of being a fixed value (\int, \sum, amsmath’s \iint family).

§scriptpos: Option<String>§dynamic_scriptpos: bool

Dynamic scriptpos: compute “mid”/“post” based on current font mathstyle at invocation time Perl: scriptpos => &doScriptpos

§operator_scriptpos: Option<usize>§stretchy: Option<bool>§operator_stretchy: Option<bool>§nogroup: bool§hide_content_reversion: bool§revert_as: Option<Cow<'static, str>>§lpadding: Option<usize>§rpadding: Option<usize>§letters_class: Option<LettersClass>

A glyph \DeclareMathSymbol’d from the math italic symbol font (letters), with its math class: the token’s font is specialized by Font::specialize_letters (a capital Greek letter italic as the class says).

§absorb_warning: Option<Stored>

A Warning that belongs to the symbol’s print, not its digestion: carried as the box’s ABSORB_WARNING_PROPERTY (on the simple primitive’s box and on a constructor’s whatsit alike) and raised once per key when the document absorbs it (absorb_warning) — an undecodable glyph’s once-per-font Warning (\DeclareMathSymbol, OXIDIZED_DESIGN_DIVERGENCES #27). A property, so a simple symbol stays on the primitive path with a simple symbol’s box and sizing.

Implementations§

Source§

impl MathPrimitiveOptions

Source

pub fn to_hash_stored(&self) -> HashMap<Stored>

Source

pub fn to_hash_stored_with_overrides( &self, mode_override: Option<&'static str>, mathstyle_override: Option<&'static str>, scriptpos_override: Option<&'static str>, ) -> HashMap<Stored>

Like to_hash_stored but applies per-invocation overrides without cloning the whole options. Used in DefMath closures (hot path — one call per math token invocation).

Source

pub fn has_complex_option(&self) -> bool

Whether an option outside Perl’s $simpletoken_options is present (Package.pm:1603-1607: name, meaning, omcd, role, mathstyle, stretchy, protected, robust, alias, lpadding, rpadding, font, scriptpos, scope, locked), which makes a parameterless DefMath a constructor rather than a box (Package.pm:1665). alias and stretchy are simple: counted complex, the eighteen stretchy delimiters (\langle, \{, \lceil, amsmath’s \lvert, …) became constructors whose font is read at construction, so \big\langle lost its size and \boldmath its bold. variablesize_op and dynamic_scriptpos are Perl’s code-valued mathstyle and scriptpos; the construct hooks are complex, as in Perl.

Trait Implementations§

Source§

impl Clone for MathPrimitiveOptions

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for MathPrimitiveOptions

Source§

fn default() -> Self

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

impl PartialEq for MathPrimitiveOptions

Source§

fn eq(&self, other: &MathPrimitiveOptions) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.