注意 当サイトは、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 ドキュメント日本語版

Attach

Subscript, superscripts, and limits.

Attachments can be displayed either as sub/superscripts, or limits. Typst automatically decides which is more suitable depending on the base, but you can also control this manually with the scripts and limits functions.

If you want the base to stretch to fit long top and bottom attachments (for example, an arrow with text above it), use the stretch function.

Example

$ sum_(i=0)^n a_i = 2^(1+i) $
Preview

Syntax

This function also has dedicated syntax for attachments after the base: Use the underscore (_) to indicate a subscript i.e. bottom attachment and the hat (^) to indicate a superscript i.e. top attachment.

Calculation

attach

A base with optional attachments.

$ attach(
  Pi, t: alpha, b: beta,
  tl: 1, tr: 2+3, bl: 4+5, br: 6,
) $
Preview

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

The base to which things are attached.

t
none content
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The top attachment, smartly positioned at top-right or above the base.

You can wrap the base in limits() or scripts() to override the smart positioning.

Default:none

b
none content
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The bottom attachment, smartly positioned at the bottom-right or below the base.

You can wrap the base in limits() or scripts() to override the smart positioning.

Default:none

tl
none content
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The top-left attachment (before the base).

Default:none

bl
none content
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The bottom-left attachment (before base).

Default:none

tr
none content
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The top-right attachment (after the base).

Default:none

br
none content
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The bottom-right attachment (after the base).

Default:none

scripts

Forces a base to display attachments as scripts.

math.scripts() -> content
$ scripts(sum)_1^2 != sum_1^2 $
Preview

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

The base to attach the scripts to.

limits

Forces a base to display attachments as limits.

math.limits() -> content
$ limits(A)_1^2 != A_1^2 $
Preview

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

The base to attach the limits to.

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

Whether to also force limits in inline equations.

When applying limits globally (e.g., through a show rule), it is typically a good idea to disable this.

Default:true