How to align terms vertically in math mode?

Hello. Welcome to the forum. There is a section about alignment in math mode: Math – Typst Documentation.

$
  K times A times N & -> & G \
  (k, a, n) & |-> & k a n
$

image

But if you need the “cell” center alignment, I think mat() is your best bet. But you can simplify your example with a substitution:

// matrix align
#let malign = math.mat.with(delim: none)

$
  malign(
    K times A times N, ->, G;
    (k, a, n), |->, k a n;
  )
$
1 Like