Breaking suggestion: about rules of alignment point "&"

see also: How to adjust alignment within Math ($$)?
see also: discussion on xmmath

just i personally think the alternating right/left alignment, the need for && to keep same alignment, feels weird/dark/magic/chooseyouword.
here’s my worse idea, free to comment, though.

in short, play with spaces like in a "b" c"d"e:
& right&left & center &also center maybe bilateral or even intellegent^(TM)&
edge cases on the first/last one within a row:
right&left \ left & right
an extra leading/trailing & is mandatory for first/last column to align center. that’s about to build a table.

the convention of a &= b is a little bit hurt but a&= b just takes a deletion of the space. and it looks closer to the outcome.

of course, i agree that &s in cases() should work just like outside.

\s inside branches… that’s another story :slightly_smiling_face: i have some wild remark in the xmmath link, though, like, i’d like to have some higher-level-parenthesis so that \s inside will behave like line-breaks inside an inline-block.
a bit off-topic about me exploring \and finding [lr(1 & 2 \ 3 & 4)] draws matrix in xmmath… what i wanna mention are stirling numbers (two kinds), although vec can do it, it isn’t semantically precise. i’d like to suggest a general binom(delim:"(",a,b) too.
if thinking even wilder… let (){}[] in math mode be essentially equivalent, that is, be available for function-calling when possible, ofc the “function” can detect on what parenthesis it’s being called, so over{} under[] cases{} mat[] binom() binom[] binom{} lr() lr[] lr{} would let us save a lot of delim: but what about #none (stop thinking

currently, cases(delim:#none) and lr(c o n t e n t) and & together nested just works fine (without control on alignment), but & inside binom seems not working at all (slap) yeah i admit it’s kinda meaningless..

1 Like

I’m sorry what? I don’t know if it’s because I’m getting older, but I really struggled to read your sentences. The styling seems to be all over the place. Not critiquing your content, but more your writing. I don’t know what I’m reading here exactly. Could you please clean up your writing?

While && is at first dark magic, I find it quite useful after being aware of it. But I (think I) do agree with you, that you can’t see straight away if it is left or right aligned. So what is your idea here? Do you want Typst’s math mode be like LaTeX’s? Or do you want to use some syntax from LaTeX in Typst?

1 Like

in short, play with spaces like in a "b" c"d"e:
& right&left & center &also center maybe bilateral or even intellegent^(TM)&

maybe my in short is too short. let’s decompose it:

  • & right&: if content touches only the RHS &, this section is aligned to the right.
  • &left &: if content touches only the LHS &, this section is aligned to the left.
  • & center &: if content touches neither &s, this section is aligned center.
  • &center or something else&: if content touches both &s, it could be aligned center or i’m not sure if something like justify-content: space-evenly as in CSS be applied here could be useful.

edge cases on the first/last one within a row:
right&left \ left & right

then the edge cases follows. the first or last section doesn’t have an “outside” guard &, so we only see whether the content touches the “inside” one &. my idea is above: when it touches “inside” one, align to the “inside” direction, otherwise, aligned to the “outside” direction.

an extra leading/trailing & is mandatory for first/last column to align center. that’s about to build a table.

i hope this makes sense.