TypstDocumentation

mat

A matrix.

The elements of a row should be separated by commas, while the rows themselves should be separated by semicolons. The semicolon syntax merges preceding arguments separated by commas into an array. You can also use this special syntax of math function calls to define custom functions that take 2D data.

Content in cells that are in the same row can be aligned with the & symbol.

Example

$ mat(
  1, 2, ..., 10;
  2, 2, ..., 10;
  dots.v, dots.v, dots.down, dots.v;
  10, 10, ..., 10;
) $
Preview

Parameters
Question mark

rows
arrayPositional
Question mark
Variadic
Question mark

An array of arrays with the rows of the matrix.

#let data = ((1, 2, 3), (4, 5, 6))
#let matrix = math.mat(..data)
$ v := matrix $
Preview

delim
stringSettable
Question mark

The delimiter to use.

#set math.mat(delim: "[")
$ mat(1, 2; 3, 4) $
Preview