I wanted to define a macro to denote the ring ideal generated by some elements. In latex I would do $\newcommand{\gen}[1]{\langle #1\rangle}$ so I could do $\gen{x}$ or $\gen{x, y}$ or $\gen{\{x \mid n \in \phi(x)\}}$ to typeset the ideal generated by one element, two elements, resp. a set of elements.
In Typst, I tried to define #let gen(generators) = $angle.l generators angle.r$. Then $gen(x)$ works fine, but when doing $gen(x, y)$, it understandibly thinks that I want to supply two arguments to a function taking only one argument. What would be the idiomatic way to proceed here?
I’d say it’s best to copy what, for example, the math.lr function does internally here and reconstruct the commas. Something like this would work: (hopefully this works, can’t test on my phone )