Typst Fumadocs

Attach

Documentation for the attach functions.

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

Loading compiler...

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.

A base with optional attachments.

Loading compiler...
#math.attach(
  base,
  t: none | content,
  b: none | content,
  tl: none | content,
  bl: none | content,
  tr: none | content,
  br: none | content
) -> content

Parameters

Prop

Type

Forces a base to display attachments as scripts.

Loading compiler...
#math.scripts(
  body
) -> content

Parameters

Prop

Type

Forces a base to display attachments as limits.

Loading compiler...
#math.limits(
  body,
  inline: bool
) -> content

Parameters

Prop

Type

On this page