This question is so simple that I am embarrassed for not having the answer myself. I’d like to know what would be the correct way to use a dictionary in a variable as the property dictionary that typst elements usually expect. For example (assuming that we are already in code mode):
The reason is that the boxprops variable -depending on the situation- can contain an arbitrary number of dictionary entries, from 0 entries up to the full set of entries that are valid for a box element.
Of course, there are complicated and ugly ways to construct a box element from a dictionary in a variable. But I’d like know if there is an easy and elegant one that I have missed.
Thank you very much in advance!
P.S. This is a general question that applies to all typst elements. The box element was just an example.
Another option is to use the argument type. From what I can see the only(?) benefit compared to a dictionary is you can include positional arguments too.
I see. Thank you very much. I had totally forgotten about argument spreading. Shame on me … had used it before, but had to focus on other tasks during the last weeks.
Regarding research, I had googled for the solution before posting of course. But obviously I had used the wrong keywords.
Thank you very much, too. I had not come across the argument type yet. It looks promising. But I still have to check whether it works if I pass a variable which already contains a dictionary to the arguments() function. Like this: #let args = arguments(boxprops,[body]). Otherwise, I couldn’t use it in my specific case.