Info
This site is generated using the static site generator developed by the Typst Community. Please adjust the text content of this banner according to your usage requirements. At Typst GmbH's request, when publishing documentation, you must clearly indicate that it is non-official and display the version of Typst being documented. For details, refer to Issue #874 on typst/typst.

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

Renders text in subscript.

The text is rendered smaller and its baseline is lowered.

Example

Revenue#sub[yearly]
Preview

Parameter
Parameter
Parameters are input values for functions. Specify them in parentheses after the function name.

typographic
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

Whether to prefer the dedicated subscript characters of the font.

If this is enabled, Typst first tries to transform the text to subscript codepoints. If that fails, it falls back to rendering lowered and shrunk normal letters.

Show example
N#sub(typographic: true)[1]
N#sub(typographic: false)[1]
Preview
Default value:
true

baseline
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The baseline shift for synthetic subscripts. Does not apply if typographic is true and the font has subscript codepoints for the given body.

Default value:
0.2em

size
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The font size for synthetic subscripts. Does not apply if typographic is true and the font has subscript codepoints for the given body.

Default value:
0.6em

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The text to display in subscript.

Open official docs

Search