How do I know from the reference that in #set text(15pt) is setting the size (without the example)?

Hi

I know that I can use #set text(size: 18pt) to set the size.

But I can also use #set text(18pt) because it is in one of the example.

However, without the example, how do I know that putting a length as first parameter will set the size of the text (size parameter), and not for example the baseline parameter ? The size parameter is not a positionnal argument, and I thought, maybe it look for the first argument compatible with the type, but for example I can’t do #set text(“DejaVu Sans Mono”)

So is it special behaviour that is not in reference exept in example, or am I missing something ?

Thanks.

1 Like

Hello @MathieuD

Nice question, not easy to find the answer.

The docs have an example demonstrating this feature but with no explanation.

This was discussed a while ago now and is worth quoting:

1 Like

Thanks !

This other topic mentionned an issue created, i think it is this one : Improve documentation for built-in functions with custom args parsing · Issue #6286 · typst/typst · GitHub

Feel free to also upvote it if you think like me that it is important !

1 Like