Skip to main content

is_column_end

Function is_column_end 

Source
pub fn is_column_end(token: &Token) -> Option<(Token, &'static str, bool)>
Expand description

Is token an alignment column end — a tab or a row end — and which one: the COLUMN_ENDS entry (the token to act on, its keyword, whether it is hidden), or (token, "align", false) for a tab.

tex.web §342/§789 insert the v-template when get_next yields cur_cmd ∈ {tab_mark, car_ret}: a column end is recognized by its COMMAND CODE, which \let copies and \def replaces. So \let\myspan\span ends a cell, while after \def\span{\mathrm{span}} a \span is a macro call — expanded, never a column end. A LaTeXML primitive’s command code is its defining cs: \let copies the Primitive/Constructor with that cs (and the format dump restores such copies as aliases of the cs), while \def/\newcommand make an Expandable. So a binding that re-DefPrimitives/DefConstructors \cr, \crcr or \span under that name makes a column end too; the frozen copies \lx@span/\lx@frozen@cr (tex_tables.rs) are column ends for the same reason. Perl Gullet.pm L266-277 compares the token’s meaning with the CURRENT meaning of each end instead, so a redefined \span (or \cr) still matched itself and ended the cell (math0004102: \def\span{{\mathrm{span}}} in an eqnarray cell split the cell at the \span and ran ^ out of math). Guard: perfect_kernel_batch65::redefined_span_is_a_macro_not_a_column_end.