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

direction自始可用Go to source

The four directions into which content can be laid out.

Possible values are:

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

#stack(dir: rtl)[A][B][C] #stack(dir: direction.rtl)[A][B][C]

定义
Question mark

from0.14.0起可用Go to source

Returns a direction from a starting point.

This function does the opposite of direction.start.

Expand展开示例
#direction.from(left) \ #direction.from(right) \ #direction.from(top) \ #direction.from(bottom)
direction.from(alignment) → direction

side
alignment
必需参数
Question mark
位置参数
Question mark

The starting point for the direction.

This cannot be start or end.

to0.14.0起可用Go to source

Returns a direction from an end point.

This function does the opposite of direction.end.

Expand展开示例
#direction.to(left) \ #direction.to(right) \ #direction.to(top) \ #direction.to(bottom)
direction.to(alignment) → direction

side
alignment
必需参数
Question mark
位置参数
Question mark

The end point for the direction.

This cannot be start or end.

axis0.7.0起可用Go to source

The axis this direction belongs to, either "horizontal" or "vertical".

Expand展开示例
#ltr.axis() \ #ttb.axis()
self.axis() → str

sign0.14.0起可用Go to source

The corresponding sign, for use in calculations.

This is the sign of the vector going this direction along the corresponding axis.

Expand展开示例
#ltr.sign() \ #rtl.sign() \ #ttb.sign() \ #btt.sign()
self.sign() → int

start0.7.0起可用Go to source

The starting point of this direction.

This function does the opposite of direction.from.

Expand展开示例
#ltr.start() \ #rtl.start() \ #ttb.start() \ #btt.start()
self.start() → alignment

end0.7.0起可用Go to source

The end point of this direction.

This function does the opposite of direction.to.

Expand展开示例
#ltr.end() \ #rtl.end() \ #ttb.end() \ #btt.end()
self.end() → alignment

inv自始可用Go to source

The inverse (opposite) direction.

Expand展开示例
#ltr.inv() \ #rtl.inv() \ #ttb.inv() \ #btt.inv()
self.inv() → direction