How to horizontally align math symbols by their center when writing a multi-line block?

Let’s say I have a multi-line block of math: a_1 + a_2 = b on line 1, dots.v on line 2, and y_1 + y_2 = z on line 3. This is the initial code:

$
a_1 + a_2 = b \
dots.v \
y_1 + y_2 = z
$

By default, Typst renders this:

I would like to align dots.v on line 2 with the center of the equals signs on lines 1 and 3. I tried using alignment points:

$
a_1 + a_2 &= b \
&dots.v \
y_1 + y_2 &= z
$

But that renders like this:

Even if I wrap the equals signs and ellipses with two alignment points (e.g.: &=& and &dots.v&), it renders the same.

Is there a (preferably easy/quick) way to horizontally align math symbols by their centers, so that vertical ellipses is in line with the center of equals signs, etc.?

Hi, welcome to the forum!

Using Matrix Function – Typst Documentation is an option:

$
  mat(
    delim: #none,
    a_1 + a_2, =, b;
    , dots.v;
    y_1 + y_2, =, z;
  )
$

(If you formula already has ,, replace them with \, when passing to mat.)

2 Likes

Thank you! Would there be a potential downside of using this method with regards to accessibility, such as with screen readers, etc.?

1 Like