How to convert content to length

You can use the sizes 2em or 0.5em to get a font size that is double or half the current font size. In the example below the first and last “hello” will have the same font size, whereas the second “hello” will have twice the current font size.

hello
#set text(size: 2em)
hello
#set text(size: 0.5em)
hello

The error in your case is caused by the fact that a context always returns content. If you want to understand this, I can recommend reading this post.

1 Like