提示:本教程存在过时问题,更详细教程请阅读 小蓝书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 中文文档

repeat 元素
元素函数可以通过 set 和 show 规则进行样式自定义。

Repeats content to the available space.

This can be useful when implementing a custom index, reference, or outline.

Space may be inserted between the instances of the body parameter, so be sure to include negative space if you need the instances to overlap.

Errors if there no bounds on the available space, as it would create infinite content.

Example

Sign on the dotted line:
#box(width: 1fr, repeat[.])

#set text(10pt)
#v(8pt, weak: true)
#align(right)[
  Berlin, the 22nd of December, 2022
]
Preview

参数
参数是函数的输入,它们在函数名称后面的括号中传入。

repeat() -> content

body
content
必需参数位置参数
位置参数按顺序传入,不带名称。

The content to repeat.