I had my gripes with LaTeX but the backslash in front of every macro was never one of them. I think it helps not only machine parsing but very much my human visual parsing.
BTW one related trap in LaTeX is if a macro without parameters removes the trailing space from the output. The article mentions this in passing but does not say what Typst's solution is. Do Typst functions always require parentheses?
I'm also confused about the following syntax and especially where the function ends:
table.header([A], [B]) // This one is clear
table.header()[A] // Makes sense, [A] turns magically into last param
table.header()[A][B] // Slightly confusing, why would [B] also belong to the function? But OK.
table.header()[A] [B] // Totally confusing, why is this an error now?
For the last case: If it is a parameter list a space should not matter, if it is not [B] should not be part of the function and treated as unrelated.
While not really related to the math topic, let me answer this:
- You can add an arbitrary number of trailing `[..]` blocks and they are just trailing arguments. So 2 & 3 are really the same.
- 3 & 4 are different because argument lists may _never_ have a space before them in Typst. you can also not write `calc.min (1, 2)`
The reason why the space may not be added is that you can write
And `range(5) [..]` therefore needs to be different from `range(5)[..]`. This aligns with normal formatting conventions and I haven't seen this become a problem in practice.Seeing it this way it makes sense. Thanks!
Plus you can always `\catcode\∘=0` if you really hate backslashes :-D