How to scale without adding line breaks?

I would expect these two lines …

Hello #scale(300%, reflow: true)[World]!
Hello #text(size: 3em)[World]!

… to have the same result. However, they don’t.

Instead, the scale function seems to be putting line breaks before and after itself. How do I prevent this?

First of all, you can format your code using a code block like this:

``​`typ
your code
``​`

Regarding your problem, you can wrap the scale in a box to make it inline:

Hello #box(scale(300%, reflow: true)[World])!

Hello #text(size: 3em)[World]!
2 Likes

@LordBaryhobal, as a nitpick, you should use Markdown language so that the code doesn’t look green:

````md
```typ
your code
```
````
example
```typ
your code
```

Additionally, if the scale() is used multiple times, then it’s better to move repetitive named arguments into a set rule:

#set scale(reflow: true)

Hello #box(scale(300%)[World])!

Or you can make a wrapper:

#let scale(scale, body) = box(std.scale(scale, reflow: true, body))

Hello #scale(300%)[World]!

For the reflow: true see these:

1 Like

That did it, thanks!

I edited the code example in my original post, too.

1 Like