提示:本教程存在过时问题,更详细教程请阅读 小蓝书Typst 中文社区导航 FAQ
注意:该中文文档为社区驱动的非官网文档,可能存在错译、漏译或过时等问题,请以官网文档 Documentation 为准,如发现错漏,也欢迎 您的贡献镜像)。Typst 非官方中文交流 QQ 群:793548390
Warning: the Chinese document is a community-driven non-official document, there may be mistranslation, omission or outdated problems, please refer to the official website documentation.
Typst 中文文档

direction

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]
Preview

定义
函数和类型可以有与其关联的定义 (成员或方法)。可以使用 "." 操作符来访问调用它们。

axis

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

self.axis(
)
查看示例
#ltr.axis() \
#ttb.axis()
Preview

start

The start point of this direction, as an alignment.

self.start(
) -> alignment
查看示例
#ltr.start() \
#rtl.start() \
#ttb.start() \
#btt.start()
Preview

end

The end point of this direction, as an alignment.

self.end(
) -> alignment
查看示例
#ltr.end() \
#rtl.end() \
#ttb.end() \
#btt.end()
Preview

inv

The inverse direction.

self.inv(
) -> direction
查看示例
#ltr.inv() \
#rtl.inv() \
#ttb.inv() \
#btt.inv()
Preview