pub struct MathEnvironment {
pub name: Name,
pub numbered: bool,
pub numbered_equations: bool,
}Expand description
The data of one element value of flm.math.environment: which display-math
environment was written, and whether its lines are numbered.
The value is also the element’s Referenceable aspect: it reads the
environment’s body as equation lines and declares one reference point per
line (see the module documentation, Equation lines, reference points and
numbers).
A lowering rule or a stage reads it from a node with
element_value.
Fields§
§name: NameThe environment’s name as written (align*).
numbered: boolWhether the environment is an unstarred form, whose lines can be
numbered. Such a line states a number
source unless \nonumber or a
\tag is written on it, or the configuration numbers no equations.
numbered_equations: boolWhether the registry numbers equations at all
(MathConfig::numbered_equations), as the configuration was when the
registry was built. A line states a number source only when this and
numbered are both true; a line of an
unstarred environment keeps its labels in either case.
Trait Implementations§
Source§impl Clone for MathEnvironment
impl Clone for MathEnvironment
Source§impl Debug for MathEnvironment
impl Debug for MathEnvironment
impl Eq for MathEnvironment
Source§impl PartialEq for MathEnvironment
impl PartialEq for MathEnvironment
Source§impl Referenceable for MathEnvironment
The reference points of a display-math environment: one per equation line,
in the order the lines are written (lines::equation_lines), including
the lines that cannot be numbered.
impl Referenceable for MathEnvironment
The reference points of a display-math environment: one per equation line,
in the order the lines are written (lines::equation_lines), including
the lines that cannot be numbered.
A line that can be numbered (a line of an unstarred environment with no
\nonumber) keeps the labels written on it and accepts the
LABEL_TYPES. It states:
- a number source when it carries no
\tagand the feature’s configuration numbers equations (MathConfig::numbered_equations): theCOUNTER, theCOUNTER_STYLEand one level to advance, so that a reference to the line shows its number; - the content of its
\tagwhen it carries one, and no number source: a reference to the line shows the tag as the author wrote it, formatting included, and the line counts in nothing.
A line with a \tag therefore states no number source and still keeps its
labels, because a reference to it shows the tag.
A line that cannot be numbered (every line of equation*, align* and
gather*, and a line marked \nonumber) keeps no label and accepts no
label type, so no reference resolves to it and no safe label is assigned
for a \label written on it. Such a \label or \tag is reported once,
when the body is parsed, as flm.math.label-without-number
(lines::LabelWithoutNumber); a \ref to that label is then
unresolved. The line is still a reference point, so that a tool can walk
every line of every environment, and it still has an anchor.
Every line’s anchor follows AnchorPolicy::Auto with the prefix
ANCHOR_PREFIX: the anchor of its first label, or one derived from its
position. A line’s mathematics is never stated as content, because a
reference shows a number or a tag, never a formula.
impl StructuralPartialEq for MathEnvironment
Auto Trait Implementations§
impl Forget for MathEnvironment
impl Freeze for MathEnvironment
impl Move for MathEnvironment
impl RefUnwindSafe for MathEnvironment
impl Send for MathEnvironment
impl Sync for MathEnvironment
impl Unpin for MathEnvironment
impl UnsafeUnpin for MathEnvironment
impl UnwindSafe for MathEnvironment
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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