ParseNodeArray

Struct ParseNodeArray 

Source
pub struct ParseNodeArray {
Show 13 fields pub mode: Mode, pub loc: Option<SourceLocation>, pub col_separation_type: Option<ColSeparationType>, pub hskip_before_and_after: Option<bool>, pub add_jot: Option<bool>, pub cols: Option<Vec<AlignSpec>>, pub arraystretch: f64, pub body: Vec<Vec<AnyParseNode>>, pub row_gaps: Vec<Option<MeasurementOwned>>, pub h_lines_before_row: Vec<Vec<bool>>, pub tags: Option<Vec<ParseNodeArrayTag>>, pub leqno: Option<bool>, pub is_cd: Option<bool>,
}
Expand description

Represents array and matrix environments in mathematical expressions.

This struct handles the parsing and representation of array-like structures such as matrices, tables, and aligned equations in LaTeX/KaTeX. It supports various column alignments, spacing, and formatting options.

§LaTeX Correspondence

Corresponds to LaTeX environments like:

\begin{pmatrix} a & b \\ c & d \end{pmatrix}  % Matrix
\begin{array}{cc} a & b \\ c & d \end{array}  % General array
\begin{align} x &= 1 \\ y &= 2 \end{align}    % Aligned equations

§Usage

Arrays are fundamental for representing matrices, systems of equations, and tabular data in mathematical typesetting. The parser creates these nodes when encountering array environments.

Fields§

§mode: Mode

The parsing mode (Mode::Math or Mode::Text)

§loc: Option<SourceLocation>

Optional source location for error reporting

§col_separation_type: Option<ColSeparationType>

Type of column separation (ColSeparationType)

§hskip_before_and_after: Option<bool>

Whether to add horizontal skip before/after the array

§add_jot: Option<bool>

Whether to add extra vertical spacing between rows

§cols: Option<Vec<AlignSpec>>

Column alignment specifications (AlignSpec)

§arraystretch: f64

Vertical stretching factor for the array

§body: Vec<Vec<AnyParseNode>>

The array content as a vector of rows, each containing cells

§row_gaps: Vec<Option<MeasurementOwned>>

Vertical gaps between rows

§h_lines_before_row: Vec<Vec<bool>>

Horizontal lines to draw before each row

§tags: Option<Vec<ParseNodeArrayTag>>

Optional equation tags/numbers for each row

§leqno: Option<bool>

Whether to place equation numbers on the left

§is_cd: Option<bool>

Whether this is a commutative diagram array

Trait Implementations§

Source§

impl Clone for ParseNodeArray

Source§

fn clone(&self) -> ParseNodeArray

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ParseNodeArray

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ParseNodeArray

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ParseNodeArray

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.