Documentation

alignmentGo to source

Where to align something along an axis.

Possible values are:

These values are available globally and also in the alignment type’s scope, so you can write either of the following two:

#align(center)[Hi]
#align(alignment.center)[Hi]

2D alignments

To align along both axes at the same time, add the two alignments using the + operator. For example, top + right aligns the content to the top right corner.

#set page(height: 3cm)
#align(center + bottom)[Hi]

Fields

The x and y fields hold the alignment’s horizontal and vertical components, respectively (as yet another alignment). They may be none.

#(top + right).x \
#left.x \
#left.y (none)

Definitions
Question mark

axisGo to source

The axis this alignment belongs to.

ExpandView example
#left.axis() \
#bottom.axis()
self.axis() → nonestr

invGo to source

The inverse alignment.

ExpandView example
#top.inv() \
#left.inv() \
#center.inv() \
#(left + bottom).inv()
self.inv() → alignment