Vectors, matrices, semicolumn syntax

Vectors

By vector we mean a column there.
To write arrow notations for letters, use $arrow(v)$
I recommend to create shortcut for this, like #let arr = math.arrow

To write columns, use vec command:

$
vec(a, b, c) + vec(1, 2, 3) = vec(a + 1, b + 2, c + 3)
$
Rendered image

Delimiter

You can change parentheses around the column or even remove them:

$
vec(1, 2, 3, delim: "{") \
vec(1, 2, 3, delim: bar.double) \
vec(1, 2, 3, delim: #none)
$
Rendered image

Gap

You can change the size of gap between rows:

$
vec(a, b, c)
vec(a, b, c, gap:#0em)
vec(a, b, c, gap:#1em)
$
Rendered image

Making gap even

You can easily note that the gap isn't necessarily even or the same in different vectors:

$
vec(a/b, a/b, a/b) = vec(1, 1, 1)
$
Rendered image

That happens because gap refers to spacing between elements, not the distance between their centers.

To fix this, you can use this snippet.

Matrix

See official reference

Matrix is very similar to vec, but accepts rows, separated by ;:

$
mat(
    1, 2, ..., 10;
    2, 2, ..., 10;
    dots.v, dots.v, dots.down, dots.v;
    10, 10, ..., 10; // `;` in the end is optional
)
$
Rendered image

Delimiters and gaps

You can specify them the same way as for vectors.

Specify the arguments either before the content, or after the semicolon. The code will panic if there is no semicolon!
$
mat(
    delim: "|",
    1, 2, ..., 10;
    2, 2, ..., 10;
    dots.v, dots.v, dots.down, dots.v;
    10, 10, ..., 10;
    gap: #0.3em
)
$
Rendered image

Semicolon syntax

When you use semicolons, the arguments between the semicolons are merged into arrays. See yourself:

#let fun(..args) = {
    args.pos()
}

$
fun(1, 2;3, 4; 6, ; 8)
$
Rendered image

If you miss some of elements, they will be replaced by none-s.

You can mix semicolon syntax and named arguments, but be careful!

#let fun(..args) = {
    repr(args.pos())
    repr(args.named())
}

$
fun(1, 2; gap: #3em, 4)
$
Rendered image

For example, this will not work:

$
//         ↓ there is no `;`, so it tries to add (gap:) to array
mat(1, 2; 4, gap: #3em)
$