注意 当サイトは、Typst v0.12.0 公式ドキュメントを、日本語コミュニティが非公式に翻訳したものです。誤訳・未訳・古い情報が含まれている可能性があるため、公式ドキュメント との併用を推奨します。このサイトの内容に誤りを発見された方は、GitHubリポジトリまでご報告を頂けましたら幸いです。我々のコミュニティにご興味のある方は、ぜひ非公式Discordサーバー「くみはんクラブ」にご参加ください。
Warning: This site provides an unofficial translation of the Typst v0.12.0 documentation by the Japanese Community. Please note that there may be some inaccuracies, untranslated sections or outdated information. We highly recommend referring to the latest official documentation as well. If you find any errors in the content, please let us know through our GitHub repository. If you are interested in our community, feel free to join our unofficial Discord server, “Kumihan Club.”
Typst ドキュメント日本語版

cancel Element
Element functions can be customized with set and show rules.

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) $
Preview

引数
Parameters are the inputs to a function. They are specified in parentheses after the function name.

body
content
RequiredPositional
Positional parameters are specified in order, without names.

The content over which the line should be placed.

length
relative
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

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.

Default:100% + 3pt

View example
$ a + cancel(x, length: #200%)
    - cancel(x, length: #200%) $
Preview

inverted
bool
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

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.

Default:false

View example
$ (a cancel((b + c), inverted: #true)) /
    cancel(b + c, inverted: #true) $
Preview

cross
bool
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

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

Default:false

View example
$ cancel(Pi, cross: #true) $
Preview

angle
auto angle function
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

How much to rotate the cancel line.

Default:auto

View example
$ 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)) $
Preview

stroke
length color gradient stroke pattern dictionary
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

How to stroke the cancel line.

Default:0.5pt

View example
$ cancel(
  sum x,
  stroke: #(
    paint: red,
    thickness: 1.5pt,
    dash: "dashed",
  ),
) $
Preview