注意:该中文文档为社区驱动的非官网文档,可能存在错译、漏译或过时等问题,请以官网文档 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 中文文档

Attach 函数族

上下标, 和上下限。

attach 函数支持形如 $a_b^c$ 的语法,可以为方程的某个方位添加附缀。 附缀可以显示为上下标和上下限的形式。 Typst会自动调整为合适的显示方式,但是您也可以使用 scripts 函数和 limits 函数 手动调整。

Example

$ sum_(i=0)^n a_i = 2^(1+i) $
Preview

语法

此函数还具有用于附基之后的附缀的专用语法:使用下划线 (_) 表示下标,即底部附缀,使用帽子 (^) 表示上标,即顶部附缀。

函数族

attach

带有可选附缀的附基。

$ attach(
  Pi, t: alpha, b: beta,
  tl: 1, tr: 2+3, bl: 4+5, br: 6,
) $
Preview

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

供附缀附着的部分。

t
none content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

顶部附缀,智能定位于附基的上方或右上方。

你也可以将附基包裹在limits()scripts() 来覆盖掉智能定位。

默认:none

b
none content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

底部附缀,智能定位于附基的下方或右下方。

你也可以将附基包裹在limits()scripts() 来覆盖掉智能定位。

默认:none

tl
none content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

左上角附缀。

默认:none

bl
none content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

左下角附缀。

默认:none

tr
none content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

右上角附缀。

默认:none

br
none content
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

右下角附缀。

默认:none

scripts

强制将附缀显示为脚本形式(即角标形式)。

math.scripts() -> content
$ scripts(sum)_1^2 != sum_1^2 $
Preview

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

供脚本附缀附着的部分。

limits

强制将附缀显示为上下限形式(即显示在正上方和正下方)。

math.limits() -> content
$ limits(A)_1^2 != A_1^2 $
Preview

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

供上下限附缀附着的部分。

inline
bool
可用 Set 规则
可以使用 Set 规则,为函数后续所有的使用设置默认参数。

是否强制显示为内联公式。

全局应用limits时(如使用 set 规则)最好禁用此功能。

默认:true