TypstDocumentation

rotateShowable
Question mark

Rotate content with affecting layout.

Rotate an element by a given angle. The layout will act as if the element was not rotated.

Example

#{
  range(16)
    .map(i => rotate(24deg * i)[X])
    .join(h(1fr))
}
Preview

Parameters
Question mark

body
contentRequiredPositional
Question mark

The content to rotate.

angle

The amount of rotation.

#rotate(angle: -1.571rad)[To space!]
Preview

origin
alignment2d alignmentSettable
Question mark

The origin of the rotation.

By default, the origin is the center of the rotated element. If, however, you wanted the bottom left corner of the rotated element to stay aligned with the baseline, you would set the origin to bottom + left.

#set text(spacing: 8pt)
#let square = square.with(width: 8pt)

#square()
#rotate(angle: 30deg, origin: center, square())
#rotate(angle: 30deg, origin: top + left, square())
#rotate(angle: 30deg, origin: bottom + right, square())
Preview