MathArray

A naturally sized math table. Each column takes the widest cell advance, and each row shares a baseline with enough height and depth for its tallest cells. The complete table is an ordinary math atom centered on the math axis.

PropertyDefaultMeaning
childrenEmptyNested row arrays, or flat JSX cells chunked by ncol. Cells can be TeX strings, elements, or null for an empty cell.
ncolAlignment count, or 1Number of columns when chunking flat children.
colsCentered columnsA string such as `"r
colsepem(0.5)Gap on each side of a column. Adjacent columns normally have twice this gap.
outerfalseAlso apply column gaps at the left and right edges.
stretch1Positive multiplier for each row's 1.2-em minimum strut. Tall cells can enlarge it.
jotfalseAdd em(0.3) of leading between rows, with none after the last.
rowgapsEmptyOptional lengths after rows. Positive values deepen the row's minimum strut; negative values move the next row upward.
hlinesEmptyRules at row boundaries, including before the first and after the last row. false is solid, true is dashed; multiple flags make multiple rules.
thicknessem(0.04)Rule thickness. Zero omits the ink.
fillInherited colorRule paint, independent of cell colors.
smallfalseDefault to script cells, half-height struts, and smallmatrix column spacing.
cell_styleInherited, or "script" when smallDefault math style for cells, independently of the table's style. Explicit styles within a cell still apply.
style / size_indexInheritedTable math style and optional TeX size index.
klass / left / right"mord"Atom classes exposed by the complete table.

Column descriptors use { type: "align", align: "l", pregap: em(0), postgap: em(1) } or { type: "separator", separator: "|" }. Explicit pre/post gaps override colsep; outer still controls whether the edge gaps apply. Adjacent vertical rules have em(0.2) between their centerlines, and stacked horizontal rules have em(0.25). Horizontal and vertical rule ink meets at the corners without changing column advances.

Use an empty <MathText /> to reserve an empty cell in flat JSX. Whitespace and conditional children in that form are skipped. Pass nested row arrays through children when constructing MathArray in JavaScript; JSX flattens expression arrays. Nested row data preserves cell positions. Ragged rows are allowed. A zero-row table is empty; an explicit empty row still reserves its strut.

Cells keep their natural size. Width offers do not wrap or shrink the table; small exact allocations report overflow. For wrapping prose cells, give Text a width; give figures and plots explicit dimensions. Use the fit prop on the table when scaling is intended. A surrounding Bracket selects delimiters after measuring all cells and rules.

See matrices and arrays and aligned equations for TeX environments.