pub struct MathGroup<ET: EngineTypes> {
pub display: Option<(Skip<ET::Dim>, Skip<ET::Dim>)>,
pub children: Box<[MathNode<ET, MathFontStyle<ET>>]>,
pub start: SourceRef<ET>,
pub end: SourceRef<ET>,
pub eqno: Option<(EqNoPosition, Box<[MathNode<ET, MathFontStyle<ET>>]>)>,
pub computed_width: OnceCell<ET::Dim>,
pub computed_height: OnceCell<ET::Dim>,
pub computed_depth: OnceCell<ET::Dim>,
}Expand description
A resolved math group; the result of a math list.
Fields§
§display: Option<(Skip<ET::Dim>, Skip<ET::Dim>)>If this is a display math group, the \abovedisplayskip and \belowdisplayskip
values.
children: Box<[MathNode<ET, MathFontStyle<ET>>]>The nodes in this group
start: SourceRef<ET>The source reference of the $ or $$ that started this group.
end: SourceRef<ET>The source reference of the $ or $$ that ended this group.
eqno: Option<(EqNoPosition, Box<[MathNode<ET, MathFontStyle<ET>>]>)>If the mathgroup contained an \eqno or \leqno,
the nodes following that command
computed_width: OnceCell<ET::Dim>The computed width of this group - i.e. the sum of the widths of the children.
computed_height: OnceCell<ET::Dim>The computed height of this group - i.e. the maximum of the heights of the children.
computed_depth: OnceCell<ET::Dim>The computed depth of this group - i.e. the maximum of the depths of the children.
Implementations§
Source§impl<ET: EngineTypes> MathGroup<ET>
impl<ET: EngineTypes> MathGroup<ET>
Sourcepub fn close(
state: &ET::State,
display: Option<(Skip<ET::Dim>, Skip<ET::Dim>)>,
start: SourceRef<ET>,
end: SourceRef<ET>,
children: Vec<MathNode<ET, UnresolvedMathFontStyle<ET>>>,
eqno: Option<(EqNoPosition, Vec<MathNode<ET, UnresolvedMathFontStyle<ET>>>)>,
) -> Self
pub fn close( state: &ET::State, display: Option<(Skip<ET::Dim>, Skip<ET::Dim>)>, start: SourceRef<ET>, end: SourceRef<ET>, children: Vec<MathNode<ET, UnresolvedMathFontStyle<ET>>>, eqno: Option<(EqNoPosition, Vec<MathNode<ET, UnresolvedMathFontStyle<ET>>>)>, ) -> Self
Create a new math group by closing a list of unresolved math nodes, iterating
over it and resolving each node by determining the appropriate MathFontStyle for
it.
If display is Some, this is a display math group, and the two
skips are the \abovedisplayskip and \belowdisplayskip values.
Trait Implementations§
Source§impl<ET: EngineTypes> NodeTrait<ET> for MathGroup<ET>
impl<ET: EngineTypes> NodeTrait<ET> for MathGroup<ET>
Source§fn display_fmt(&self, indent: usize, f: &mut Formatter<'_>) -> Result
fn display_fmt(&self, indent: usize, f: &mut Formatter<'_>) -> Result
indent value to indent the stringfn sourceref(&self) -> Option<(&SourceRef<ET>, &SourceRef<ET>)>
Source§fn display(&self) -> DisplayNode<'_, ET, Self>
fn display(&self) -> DisplayNode<'_, ET, Self>
Display and uses Self::display_fmt
to yield a human-readable string.Source§fn opaque(&self) -> bool
fn opaque(&self) -> bool
\unskip
or \lastbox, this node should not be considered. Useful for annotation/marker nodes
some engine wants to insert, without impacting algorithms that inspect e.g. the last node
of the current list.Auto Trait Implementations§
impl<ET> !Freeze for MathGroup<ET>
impl<ET> !RefUnwindSafe for MathGroup<ET>
impl<ET> Send for MathGroup<ET>where
<<ET as EngineTypes>::File as File>::SourceRefID: Send,
<ET as EngineTypes>::Dim: Send,
<ET as EngineTypes>::MuDim: Send,
<ET as EngineTypes>::CustomNode: Send,
<ET as EngineTypes>::Font: Send,
ET: Send,
<ET as EngineTypes>::Char: Send,
impl<ET> !Sync for MathGroup<ET>
impl<ET> Unpin for MathGroup<ET>
impl<ET> UnsafeUnpin for MathGroup<ET>where
<<ET as EngineTypes>::File as File>::SourceRefID: UnsafeUnpin,
<ET as EngineTypes>::Dim: UnsafeUnpin,
impl<ET> UnwindSafe for MathGroup<ET>where
<<ET as EngineTypes>::File as File>::SourceRefID: UnwindSafe,
<ET as EngineTypes>::Dim: UnwindSafe,
<ET as EngineTypes>::MuDim: UnwindSafe,
<ET as EngineTypes>::CustomNode: UnwindSafe,
<ET as EngineTypes>::Font: UnwindSafe,
ET: UnwindSafe,
<ET as EngineTypes>::Char: UnwindSafe,
<ET as EngineTypes>::Token: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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