注意 / 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+后期随缘更新

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

强制使用特定数学类。

这对于将某些符号视为不同的类很有用,例如,使符号的显示行为类似于关系运算符。

Example

#let loves = math.class(
  "relation",
  sym.suit.heart,
)

$x loves y and y loves 5$
Preview

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

math.class(
string
,
)->

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

应用于内容的类。

可填写的值
  • normal

    非特殊事物的默认类。

  • punctuation

    标点符号,例如逗号。

  • opening

    起始分隔符,例如 (

  • closing

    结束分隔符,例如 )

  • fence

    两边相同的分隔符,例如 |

  • large

    sum 这样的大型运算符。

  • relation

    =prec 这样的关系运算符。

  • unary

    not 这样的一元运算符。

  • binary

    times 这样的二元运算符。

  • vary

    一个运算符,可以是一元或二进制的运算符,如 +

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

类所应用的内容。

转到官方文档(英文)

搜索