How can I rotate part of a caption?

I would like to rotate part of a figure caption, i.e.

#figure(
  square(size: 25em, stroke: 2pt),
  caption: [Pointed arrow should be here: #rotate(-45deg, $arrow$)]
)

which renders the arrow on a new line in the caption. Is there something I am missing using rotate in a caption, or is this possibly a bug?

Rotate elements are block level, so you’d put it in a box to have it as part of a line. See here for a longer description/discussion on block and inline elements:

1 Like