TypstDocumentation

padElement
Question mark

Add spacing around content.

The pad function adds spacing around content. The spacing can be specified for each side individually, or for all sides at once by specifying a positional argument.

Example

#set align(center)

#pad(x: 16pt, image("typing.jpg"))
_Typing speeds can be
 measured in words per minute._
Preview

Parameters
Question mark

left
relative length
Settable
Question mark

The padding at the left side.

Default: 0pt

top
relative length
Settable
Question mark

The padding at the top side.

Default: 0pt

right
relative length
Settable
Question mark

The padding at the right side.

Default: 0pt

bottom
relative length
Settable
Question mark

The padding at the bottom side.

Default: 0pt

x
relative length
Settable
Question mark

The horizontal padding. Both left and right take precedence over this.

Default: 0pt

y
relative length
Settable
Question mark

The vertical padding. Both top and bottom take precedence over this.

Default: 0pt

rest
relative length
Settable
Question mark

The padding for all sides. All other parameters take precedence over this.

Default: 0pt

body
content
RequiredPositional
Question mark

The content to pad at the sides.