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

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

数学表达式。

可以为内联显示或作为单独的文本块显示。

Example

#set text(font: "New Computer Modern")

Let $a$, $b$, and $c$ be the side
lengths of right-angled triangle.
Then, we know that:
$ a^2 + b^2 = c^2 $

Prove by induction:
$ sum_(k=1)^n k = (n(n+1)) / 2 $
Preview

语法

该函数也有一个专用语法: 在美元符号内编写数学标记以创建表达式。 在表达式开头和结尾添加至少一个空格,可以将其提升至水平居中的单独的文本块中显示中。详情请参考: math 页面.

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

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

Whether the equation is displayed as a separate block.

默认值:

false

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

如何对表达式进行 编号

默认值:

none

展开例子
#set math.equation(numbering: "(1)")

We define:
$ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>

With @ratio, we get:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $
Preview

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

数学表达式的补充内容。

添加在被引用的公式编号的前面。

如果指定了一个函数,将会传入引用的表达式,并返回其内容。

默认值:

auto

展开例子
#set math.equation(numbering: "(1)", supplement: [Eq.])

We define:
$ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>

With @ratio, we get:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $
Preview

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

The contents of the equation.

转到官方文档(英文)

搜索