How do I use the rotate function in the CeTZ content environment?

hey, I’m trying to use the rotate function in the CeTZ environment like this:

#figure(
cetz.canvas(
{
import cetz.draw: *
content((0,0), rotate(90deg)[U])
}
)
)

However, this doesn‘t work. I get this error message: Assertion failed: Rotate takes a single z-angle or angles (x, y, z or yaw, pitch, roll) as named arguments, got: arguments(90deg, [U])

When using rotate outside the CeTZ environment, it does exactly what i would expect it to do. What am I missing? Is there maybe a better way of rotating text within CeTZ?
Thanks!

Hi @Johannes,

cetz has a build in angle argument.

#import "@preview/cetz:0.3.2"

#figure(
  cetz.canvas({
    import cetz.draw: *
    content((0,0), angle:90deg, [U])
  })
)

Please use backticks to format your code correctly on the forum.

```typst
...
```

Thank you, works like a charm.

1 Like