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

terms元素
Question mark
自始可用Go to source

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.

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.

参数
Question mark

tight
bool
可用set规则
Question mark
默认值:true

Defines the default spacing of the term list. If it is false, the items are spaced apart with paragraph spacing. If it is true, they use paragraph leading instead. This makes the 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. The markup-defined tightness cannot be overridden with set rules.

Expand展开示例
/ 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.

separator
content
可用set规则
Question mark
默认值:h(amount: 0.6em, weak: true)

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.

Expand展开示例
#set terms(separator: [: ]) / Colon: A nice separator symbol.

indent
length
可用set规则
Question mark
默认值:0pt

The indentation of each item.

hanging-indent
length
可用set规则
Question mark
默认值:2em

The hanging indent of the description.

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

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

spacing
auto or length
可用set规则
Question mark
默认值:auto

The spacing between the items of the term list.

If set to auto, uses paragraph leading for tight term lists and paragraph spacing for wide (non-tight) term lists.

children
content
必需参数
Question mark
位置参数
Question mark
变长参数
Question mark

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.

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

定义
Question mark

item元素
Question mark
0.4.0起可用Go to source

A term list item.

terms.item() → content

term
content
必需参数
Question mark
位置参数
Question mark

The term described by the list item.

description
content
必需参数
Question mark
位置参数
Question mark

The description of the term.