pub enum MathStyle {
Display,
DisplayCramped,
Text,
TextCramped,
Script,
ScriptCramped,
ScriptScript,
ScriptScriptCramped,
}Expand description
Math style, including cramped variants.
Display and text are script-level 0; \scriptstyle is 1; \scriptscriptstyle
is 2. Cramped variants are used under radicals and in denominators.
§Examples
use latex_rust::MathStyle;
assert_eq!(MathStyle::Display.numerator().gold(), "text");
assert!(MathStyle::Display.cramp().is_cramped());Variants§
Display
Display math ($$, \[).
DisplayCramped
Cramped display (e.g. under a radical in display).
Text
Text / inline math ($, \().
TextCramped
Cramped text.
Script
First-level script.
ScriptCramped
Cramped script.
ScriptScript
Second-level script.
ScriptScriptCramped
Cramped scriptscript.
Implementations§
Source§impl MathStyle
impl MathStyle
Sourcepub fn is_display(self) -> bool
pub fn is_display(self) -> bool
True for the two display styles.
Sourcepub fn is_cramped(self) -> bool
pub fn is_cramped(self) -> bool
True when cramped.
Sourcepub fn script_level(self) -> u8
pub fn script_level(self) -> u8
Script nest level: 0 text/display, 1 script, 2 scriptscript.
Sourcepub fn into_script(self) -> Self
pub fn into_script(self) -> Self
Style for a superscript or subscript of this style.
Sourcepub fn numerator(self) -> Self
pub fn numerator(self) -> Self
Numerator style (TeX: display → text, otherwise one script tighter; not cramped).
Sourcepub fn denominator(self) -> Self
pub fn denominator(self) -> Self
Denominator style (numerator style, cramped).
Trait Implementations§
impl Copy for MathStyle
impl Eq for MathStyle
impl StructuralPartialEq for MathStyle
Auto Trait Implementations§
impl Freeze for MathStyle
impl RefUnwindSafe for MathStyle
impl Send for MathStyle
impl Sync for MathStyle
impl Unpin for MathStyle
impl UnsafeUnpin for MathStyle
impl UnwindSafe for MathStyle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more