pub struct Alignment {
pub is_halign: bool,
pub head_rows: Vec<Row>,
pub foot_rows: Vec<Row>,
/* private fields */
}Fields§
§is_halign: boolTrue for \halign templates
head_rows: Vec<Row>§foot_rows: Vec<Row>Implementations§
Source§impl Alignment
impl Alignment
Sourcepub fn new(config: AlignmentConfig) -> Self
pub fn new(config: AlignmentConfig) -> Self
Create a new Alignment.
config can contain:
- template: an Alignment::Template object
- openContainer: creates the container element with given attributes
- closeContainer = sub($doc); closes the container
- openRow = sub($doc,%attrib); creates the row element with given attributes
- closeRow = closes the row
- openColumn = sub($doc,%attrib); creates the column element with given attributes
- closeColumn = closes the column
- properties = hashmap containing extra attributes for the container element.
- xml_attributes = hashmap containing attributes for the main XML node
pub fn get_template(&self) -> &Template
pub fn get_template_mut(&mut self) -> &mut Template
pub fn current_row(&self) -> Option<&Row>
pub fn current_row_mut(&mut self) -> Option<&mut Row>
pub fn new_row(&mut self) -> Option<&Row>
pub fn remove_row(&mut self) -> Option<Row>
Sourcepub fn set_row_disposition(&mut self, disposition: RowDisposition)
pub fn set_row_disposition(&mut self, disposition: RowDisposition)
Ask for the current row’s disposition at its end (RowDisposition).
Sourcepub fn column_ended(&mut self)
pub fn column_ended(&mut self)
A column ended (&): a RowDisposition::Route is withdrawn.
Sourcepub fn dispose_ended_row(&mut self)
pub fn dispose_ended_row(&mut self)
The row just ended, removed if its disposition says so.
pub fn prepend_rows(&mut self, new_rows: Vec<Row>)
pub fn append_rows(&mut self, new_rows: Vec<Row>)
pub fn rows(&self) -> &VecDeque<Row> ⓘ
pub fn rows_mut(&mut self) -> &mut VecDeque<Row> ⓘ
Sourcepub fn transpose(&mut self)
pub fn transpose(&mut self)
Turns the rows read into the table’s columns: \valign’s body is read as \halign’s is, but each line its \cr
ends is a column of the table, its &-separated entries stacked from the top (tex.web §768, §785), and a span
covers rows. A column shorter than the longest ends in empty cells; the material a \noalign put between
columns opens the first row.
pub fn get_cached_height(&self) -> Option<Dimension>
pub fn get_cached_depth(&self) -> Option<Dimension>
pub fn get_row_heights(&self) -> &[Dimension]
pub fn get_row_depths(&self) -> &[Dimension]
pub fn get_column_widths(&self) -> &[Dimension]
Sourcepub fn normalize(&mut self) -> Result<()>
pub fn normalize(&mut self) -> Result<()>
Run normalization (cell sizes, spans, pruning, positioning). Perl: $alignment->normalizeAlignment
pub fn add_line(&mut self, border: &str, cols: Vec<usize>)
Sourcepub fn add_dashed_line(&mut self, border: &str, cols: Vec<usize>)
pub fn add_dashed_line(&mut self, border: &str, cols: Vec<usize>)
Self::add_line for a dashed rule (arydshln’s \hdashline, \cdashline): the sides it borders are dashed.
pub fn next_column(&mut self) -> Result<Option<&mut Cell>>
pub fn last_column(&mut self) -> Option<&mut Cell>
pub fn current_column_number(&self) -> usize
Sourcepub fn cell_start_column(&self) -> usize
pub fn cell_start_column(&self) -> usize
The open cell’s alignmentStartColumn, as its start_column bound it.
Sourcepub fn cell_in_math(&self) -> bool
pub fn cell_in_math(&self) -> bool
The open cell’s IN_MATH, as its frame holds it (a formula in the cell is a group nested in it).
Sourcepub fn set_row_property(&mut self, key: &str, value: String)
pub fn set_row_property(&mut self, key: &str, value: String)
Set a property on the current row (for attributes like backgroundcolor from \rowcolor)
pub fn current_row_number(&self) -> usize
Sourcepub fn get_name(&self) -> Option<&str>
pub fn get_name(&self) -> Option<&str>
The alignment’s name XML attribute (e.g. multline, gathered), set
via the container bindings. Perl reads $$alignment{properties}{attributes} {name}; here it lives in xml_attributes. Used by amsmath’s \shove*.
pub fn current_column(&mut self) -> Option<&mut Cell>
pub fn get_column(&mut self, n: usize) -> Option<&mut Cell>
pub fn get_column_mut(&mut self, n: usize) -> Option<&mut Cell>
pub fn add_before_row(&mut self, boxes: Vec<Digested>)
pub fn add_after_row(&mut self, boxes: Vec<Digested>)
pub fn omit_column(&mut self)
pub fn omit_next_column(&mut self)
Sourcepub fn omit_next_column_as_text(&mut self)
pub fn omit_next_column_as_text(&mut self)
Self::omit_next_column, the cell’s material boxed as text (Cell::omit_text_box).
pub fn get_column_before(&mut self) -> Tokens
pub fn get_column_after(&mut self) -> Tokens
pub fn revert(&self) -> Result<Tokens>
pub fn set_reversion(&mut self, rev: Tokens)
pub fn set_content_reversion(&mut self, rev: Tokens)
pub fn is_in_row(&self) -> bool
Sourcepub fn is_math(&self) -> bool
pub fn is_math(&self) -> bool
A math alignment (array, amsmath’s environments), not a text one (tabular).
pub fn is_in_column(&self) -> bool
pub fn start_row(&mut self, pseudorow: bool) -> Result<()>
pub fn end_row(&mut self) -> Result<()>
pub fn start_column(&mut self, pseudorow: bool) -> Result<()>
pub fn end_column(&mut self) -> Result<()>
pub fn set_in_tabular_head(&mut self)
pub fn unset_in_tabular_head(&mut self)
pub fn is_in_tabular_head(&self) -> bool
pub fn get_properties_mut(&mut self) -> &mut SymHashMap<Stored>
pub fn get_xml_attributes_mut(&mut self) -> &mut HashMap<String, String>
Trait Implementations§
Source§impl BoxOps for Alignment
impl BoxOps for Alignment
Source§fn get_properties(&self) -> &SymHashMap<Stored>
fn get_properties(&self) -> &SymHashMap<Stored>
with_properties instead.Source§fn with_properties<R, FnR>(&self, caller: FnR) -> R
fn with_properties<R, FnR>(&self, caller: FnR) -> R
Source§fn get_property(&self, key: &str) -> Option<Cow<'_, Stored>>
fn get_property(&self, key: &str) -> Option<Cow<'_, Stored>>
Source§fn get_properties_mut(&mut self) -> &mut SymHashMap<Stored>
fn get_properties_mut(&mut self) -> &mut SymHashMap<Stored>
Source§fn compute_size(
&self,
_options: SymHashMap<Stored>,
) -> Result<(Dimension, Dimension, Dimension)>
fn compute_size( &self, _options: SymHashMap<Stored>, ) -> Result<(Dimension, Dimension, Dimension)>
Source§fn get_string(&self) -> Result<Cow<'_, str>>
fn get_string(&self) -> Result<Cow<'_, str>>
Source§fn compute_size_and_cache(
&mut self,
_options: SymHashMap<Stored>,
) -> Result<(Dimension, Dimension, Dimension)>
fn compute_size_and_cache( &mut self, _options: SymHashMap<Stored>, ) -> Result<(Dimension, Dimension, Dimension)>
computeSizeStore (Box.pm:266-297). A box whose size is completely
specified keeps that size, and its contents are not measured (:275-281):
width, height and depth all given, a space’s width, or a vertical space’s
height or depth. A pgf picture declares its size, and sizing a box that
holds one walked every drawing box of it (pgf-spectraPreviewDataLSE, 56kq).
Perl #2798 (S5, padding slice): the size then takes any requested
pad{top,bottom,left,right} (display math
\abovedisplayskip/\belowdisplayskip, \overline/\underline 2pt,
items/equations). Not ported: a partly specified size keeping its given
parts over the computed ones, and isEmpty — a mechanical port of those
regressed (Rust boxes don’t use width/height/depth uniformly as “requested
box size”; docs/archive/UPSTREAM_SYNC_2767_to_2833_2026-06-26.md, U2 and
slice S5); tracked with K18 in docs/SYNC_STATUS.md.Source§fn be_absorbed(&self, _document: &mut Document) -> Result<Vec<Node>>
fn be_absorbed(&self, _document: &mut Document) -> Result<Vec<Node>>
Document XML - returning the corresponding nodesSource§fn be_absorbed_mut(&mut self, document: &mut Document) -> Result<Vec<Node>>
fn be_absorbed_mut(&mut self, document: &mut Document) -> Result<Vec<Node>>
Alignment only)Source§fn unlist(&self) -> Vec<Digested>
fn unlist(&self) -> Vec<Digested>
fn unlist_ref(&self) -> Vec<Cow<'_, Digested>>
Source§fn get_tokens(&self) -> Option<&Tokens>
fn get_tokens(&self) -> Option<&Tokens>
Source§fn set_property<T: Into<Stored>>(&mut self, key: &str, value: T)
fn set_property<T: Into<Stored>>(&mut self, key: &str, value: T)
Stored types for values)Source§fn set_memo_property<T: Into<Stored>>(&mut self, key: &str, value: T)
fn set_memo_property<T: Into<Stored>>(&mut self, key: &str, value: T)
BoxOps::set_property for a memo — a value the box can compute again — which a box busy elsewhere (being
absorbed) does without, where Perl’s plain hash store (Box.pm:294-296) always lands.fn get_property_string(&self, key: &str) -> String
Source§fn get_property_mut(&mut self, key: &str) -> Option<&mut Stored>
fn get_property_mut(&mut self, key: &str) -> Option<&mut Stored>
Source§fn has_property(&self, key: &str) -> bool
fn has_property(&self, key: &str) -> bool
Source§fn get_property_bool(&self, key: &str) -> bool
fn get_property_bool(&self, key: &str) -> bool
Stored::Bool)Source§fn get_body(&self) -> Result<Option<Digested>>
fn get_body(&self) -> Result<Option<Digested>>
Source§fn get_width(
&self,
options: Option<HashMap<Stored>>,
) -> Result<Option<RegisterValue>>
fn get_width( &self, options: Option<HashMap<Stored>>, ) -> Result<Option<RegisterValue>>
Source§fn set_height<T: Into<Stored>>(&mut self, width: T)
fn set_height<T: Into<Stored>>(&mut self, width: T)
Source§fn get_height(&self) -> Option<RegisterValue>
fn get_height(&self) -> Option<RegisterValue>
Source§fn get_depth(&self) -> Option<RegisterValue>
fn get_depth(&self) -> Option<RegisterValue>
Source§fn get_size(
&mut self,
options: Option<HashMap<Stored>>,
) -> Result<(Dimension, Dimension, Dimension, Dimension, Dimension, Dimension)>
fn get_size( &mut self, options: Option<HashMap<Stored>>, ) -> Result<(Dimension, Dimension, Dimension, Dimension, Dimension, Dimension)>
Digested::get_size for a variant with interior mutability which caches the box sizeSource§impl Object for Alignment
impl Object for Alignment
fn stringify(&self) -> String
fn isa_box(&self) -> bool
fn is_expandable(&self) -> bool
fn is_definition(&self) -> bool
fn is_comment(&self) -> bool
fn be_digested(self) -> Result<Digested>
Source§fn get_locator(&self) -> Option<Locator>
fn get_locator(&self) -> Option<Locator>
None is the honest
“no recorded source position” (replacing the old Locator::default()
file!()/line!() sentinel). For “where the parser is now” (error
reporting, box creation), use the free fn gullet::get_locator().Source§fn get_origin(&self) -> DefinitionOrigin
fn get_origin(&self) -> DefinitionOrigin
definition::origin). The
default is Unknown, which counts as LaTeXML’s own.