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

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

A mathematical equation.

Can be displayed inline with text or as a separate block. An equation becomes block-level through the presence of whitespace after the opening dollar sign and whitespace before the closing dollar sign.

Example

#set text(font: "New Computer Modern") Let $a$, $b$, and $c$ be the side lengths of a 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 $

By default, block-level equations will not break across pages. This can be changed through show math.equation: set block(breakable: true).

Syntax

This function also has dedicated syntax: Write mathematical markup within dollar signs to create an equation. Starting and ending the equation with whitespace lifts it into a separate block that is centered horizontally. For more details about math syntax, see the main math page.

参数
Question mark

block
bool
可用set规则
Question mark
默认值:false

Whether the equation is displayed as a separate block.

numbering
none or str or function
可用set规则
Question mark
默认值:none

How to number block-level equations. Accepts a numbering pattern or function taking a single number.

Expand展开示例
#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) $

number-align
alignment
可用set规则
Question mark
默认值:end + horizon

The alignment of the equation numbering.

By default, the alignment is end + horizon. For the horizontal component, you can use right, left, or start and end of the text direction; for the vertical component, you can use top, horizon, or bottom.

Expand展开示例
#set math.equation(numbering: "(1)", number-align: bottom) We can calculate: $ E &= sqrt(m_0^2 + p^2) \ &approx 125 "GeV" $

supplement
none or auto or content or function
可用set规则
Question mark
默认值:auto

A supplement for the equation.

For references to equations, this is added before the referenced number.

If a function is specified, it is passed the referenced equation and should return content.

Expand展开示例
#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) $

alt
none or str
可用set规则
Question mark
默认值:none

An alternative description of the mathematical equation.

This should describe the full equation in natural language and will be made available to Assistive Technology. You can learn more in the Textual Representations section of the Accessibility Guide.

Expand展开示例
#math.equation( alt: "integral from 1 to infinity of a x squared plus b with respect to x", block: true, $ integral_1^oo a x^2 + b dif x $, )

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

The contents of the equation.