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

cancel元素
Question mark
0.3.0起可用Go to source

Displays a diagonal line over a part of an equation.

This is commonly used to show the elimination of a term.

Example

Here, we can simplify: $ (a dot b dot cancel(x)) / cancel(x) $

参数
Question mark

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

The content over which the line should be placed.

length
relative
可用set规则
Question mark
默认值:100% + 0.3em

The length of the line, relative to the length of the diagonal spanning the whole element being “cancelled”. A value of 100% would then have the line span precisely the element’s diagonal.

Expand展开示例
$ a + cancel(x, length: #200%) - cancel(x, length: #200%) $

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

Whether the cancel line should be inverted (flipped along the y-axis). For the default angle setting, inverted means the cancel line points to the top left instead of top right.

Expand展开示例
$ (a cancel((b + c), inverted: #true)) / cancel(b + c, inverted: #true) $

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

Whether two opposing cancel lines should be drawn, forming a cross over the element. Overrides inverted.

Expand展开示例
$ cancel(Pi, cross: #true) $

angle
auto or angle or function
可用set规则
Question mark
默认值:auto

How much to rotate the cancel line.

Expand展开示例
$ cancel(Pi) cancel(Pi, angle: #0deg) cancel(Pi, angle: #45deg) cancel(Pi, angle: #90deg) cancel(1/(1+x), angle: #(a => a + 45deg)) cancel(1/(1+x), angle: #(a => a + 90deg)) $

stroke
length or color or gradient or stroke or tiling or dictionary
可用set规则
Question mark
默认值:0.05em

How to stroke the cancel line.

Expand展开示例
$ cancel( sum x, stroke: #( paint: red, thickness: 1.5pt, dash: "dashed", ), ) $

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

Whether the line is placed behind the content.

Expand展开示例
#set math.cancel(stroke: red + 2pt) $ cancel("behind", background: #true) \ cancel("in front", background: #false) $