Development build 586e1bd4
Typst文档简体中文版v0.15.1 + dev 586e1bd4

alignment自始可用Go 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)

定义
Question mark

axis0.7.0起可用Go to source

The axis this alignment belongs to.

Expand展开示例
#left.axis() \ #bottom.axis()
self.axis() → nonestr

inv0.7.0起可用Go to source

The inverse alignment.

Expand展开示例
#top.inv() \ #left.inv() \ #center.inv() \ #(left + bottom).inv()
self.inv() → alignment