GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • TypstDocumentation
  • GitHub
  • Discord
  • Mastodon
  • Bluesky
  • LinkedIn
  • Home
  • Pricing
  • Universe
  • Forum
  • Sign in
  • Sign up
  • Tutorial
  • Writing in Typst

This view

  • Original page
  • New address

GeezerVison is showing typst.app — Subscript - Typst Documentation

  • Docs
  • Reference
  • Text
  • Subscript

subElement
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]

Parameters

sub(
typographic: bool,baseline: autolength,size: autolength,content,
) → content

typographic
bool
Settable
Settable parameters can be customized for all following uses of the function with a set rule.
Default: true

Whether to use subscript glyphs from the font if available.

Ideally, subscripts glyphs are provided by the font (using the subs OpenType feature). Otherwise, Typst is able to synthesize subscripts by lowering and scaling down regular glyphs.

When this is set to false, synthesized glyphs will be used regardless of whether the font provides dedicated subscript glyphs. When true, synthesized glyphs may still be used in case the font does not provide the necessary subscript glyphs.

ExpandView example
N#sub(typographic: true)[1]
N#sub(typographic: false)[1]

baseline
auto or length
Settable
Settable parameters can be customized for all following uses of the function with a set rule.
Default: auto

The downward baseline shift for synthesized subscripts.

This only applies to synthesized subscripts. In other words, this has no effect if typographic is true and the font provides the necessary subscript glyphs.

If set to auto, the baseline is shifted according to the metrics provided by the font, with a fallback to 0.2em in case the font does not define the necessary metrics.

When using multiple fonts, it might be necessary to set baseline and size explicitly. See super for an example.

size
auto or length
Settable
Settable parameters can be customized for all following uses of the function with a set rule.
Default: auto

The font size for synthesized subscripts.

This only applies to synthesized subscripts. In other words, this has no effect if typographic is true and the font provides the necessary subscript glyphs.

If set to auto, the size is scaled according to the metrics provided by the font, with a fallback to 0.6em in case the font does not define the necessary metrics.

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

The text to display in subscript.

←
StrikethroughPrevious page
→
SuperscriptNext page
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.