注意 / Info
本站经 Typst GmbH 许可,提供 Typst v0.10.0+后期随缘更新 官方文档的翻译,由中文社区维护。建议与官方文档一同阅读,因为可能存在错译、漏译或过时信息。如有意改进翻译内容或网站本身,可在GitHub上提出 Issue、发起 Pull Requests。此外,也欢迎加入「Typst 非官方中文交流群」(QQ 793548390)
This site provides a Chinese translation of the Typst v0.10.0+后期随缘更新 documentation maintained by the “Typst Chinese Community” with permission from Typst GmbH. We recommend using this alongside the official documentation. We welcome contributions through Issues and Pull Requests on our GitHub repository for both translation improvements and website enhancements. Feel free to join our QQ chat group “Typst 非官方中文交流群” (793548390).
Typst文档简体中文版
v0.10.0+后期随缘更新

terms
元素
元素
元素函数可用setshow规则自定义样式。

A list of terms and their descriptions.

Displays a sequence of terms and their descriptions vertically. When the descriptions span over multiple lines, they use hanging indent to communicate the visual hierarchy.

Example

/ Ligature: A merged glyph.
/ Kerning: A spacing adjustment
  between two adjacent letters.
Preview

Syntax

This function also has dedicated syntax: Starting a line with a slash, followed by a term, a colon and a description creates a term list item.

参数
参数
参数是传给函数的输入,写在函数名后的括号中。

tight
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

If this is false, the items are spaced apart with term list spacing. If it is true, they use normal leading instead. This makes the term list more compact, which can look better if the items are short.

In markup mode, the value of this parameter is determined based on whether items are separated with a blank line. If items directly follow each other, this is set to true; if items are separated by a blank line, this is set to false.

默认值:

true

展开例子
/ Fact: If a term list has a lot
  of text, and maybe other inline
  content, it should not be tight
  anymore.

/ Tip: To make it wide, simply
  insert a blank line between the
  items.
Preview

separator
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

The separator between the item and the description.

If you want to just separate them with a certain amount of space, use h(2cm, weak: true) as the separator and replace 2cm with your desired amount of space.

默认值:

h(amount: 0.6em, weak: true)

展开例子
#set terms(separator: [: ])

/ Colon: A nice separator symbol.
Preview

indent
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

The indentation of each item.

默认值:

0pt

hanging-indent
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

The hanging indent of the description.

This is in addition to the whole item's indent.

默认值:

2em

展开例子
#set terms(hanging-indent: 0pt)
/ Term: This term list does not
  make use of hanging indents.
Preview

spacing
可用set规则
可用set规则
可用set规则设置参数,更改后续调用时的默认值。

The spacing between the items of a wide (non-tight) term list.

If set to auto, uses the spacing below blocks.

默认值:

auto

children
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。
变长参数
变长参数
变长参数可以传入多次。

The term list's children.

When using the term list syntax, adjacent items are automatically collected into term lists, even through constructs like for loops.

展开例子
#for (year, product) in (
  "1978": "TeX",
  "1984": "LaTeX",
  "2019": "Typst",
) [/ #product: Born in #year.]
Preview

定义
定义
这些函数和类型带有附属定义。要访问这种定义,请先写上函数或类型的名称,再加上定义的名称,并用句点在中间分隔。

item
元素
元素
元素函数可用setshow规则自定义样式。

A term list item.

terms.item()->

term
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。

The term described by the list item.

description
必需参数
必需参数
必需参数在调用函数时必须传入。
位置参数
位置参数
位置参数按顺序传入,不带参数名。

The description of the term.

转到官方文档(英文)

搜索