typst/docs/reference/groups.yml

170 lines
4.9 KiB
YAML
Raw Permalink Normal View History

2023-06-06 19:10:16 +02:00
# This is responsible for the fact that certain math functions are grouped
# together into one documentation page although they are not part of any scope.
- name: variants
2023-11-23 16:25:49 +01:00
title: Variants
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
filter: ["serif", "sans", "frak", "mono", "bb", "cal"]
details: |
Alternate typefaces within formulas.
These functions are distinct from the [`text`] function because math fonts
contain multiple variants of each letter.
- name: styles
2023-11-23 16:25:49 +01:00
title: Styles
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
filter: ["upright", "italic", "bold"]
details: |
Alternate letterforms within formulas.
These functions are distinct from the [`text`] function because math fonts
contain multiple variants of each letter.
2023-05-23 12:22:27 +03:00
- name: sizes
2023-11-23 16:25:49 +01:00
title: Sizes
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
filter: ["display", "inline", "script", "sscript"]
details: |
2023-05-23 12:22:27 +03:00
Forced size styles for expressions within formulas.
These functions allow manual configuration of the size of equation elements
to make them look as in a display/inline equation or as if used in a root or
sub/superscripts.
- name: underover
2023-11-23 16:25:49 +01:00
title: Under/Over
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
filter: [
"underline",
"overline",
"underbrace",
"overbrace",
"underbracket",
"overbracket",
]
2023-11-23 16:25:49 +01:00
details: |
2023-03-18 19:27:31 +01:00
Delimiters above or below parts of an equation.
The braces and brackets further allow you to add an optional annotation
below or above themselves.
- name: roots
2023-11-23 16:25:49 +01:00
title: Roots
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
filter: ["root", "sqrt"]
details: |
2023-09-11 15:53:20 +02:00
Square and non-square roots.
# Example
```example
$ sqrt(3 - 2 sqrt(2)) = sqrt(2) - 1 $
$ root(3, x) $
```
- name: attach
2023-11-23 16:25:49 +01:00
title: Attach
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
filter: ["attach", "scripts", "limits"]
details: |
Subscript, superscripts, and limits.
2023-09-11 15:53:20 +02:00
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.
# Example
```example
$ sum_(i=0)^n a_i = 2^(1+i) $
```
# 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.
- name: lr
2023-11-23 16:25:49 +01:00
title: Left/Right
2023-09-11 15:53:20 +02:00
category: math
2023-11-23 16:25:49 +01:00
path: ["math"]
2023-11-27 16:04:47 +01:00
filter: ["lr", "mid", "abs", "norm", "floor", "ceil", "round"]
2023-11-23 16:25:49 +01:00
details: |
Delimiter matching.
The `lr` function allows you to match two delimiters and scale them with the
content they contain. While this also happens automatically for delimiters
that match syntactically, `lr` allows you to match two arbitrary delimiters
and control their size exactly. Apart from the `lr` function, Typst provides
a few more functions that create delimiter pairings for absolute, ceiled,
and floored values as well as norms.
2023-09-11 15:53:20 +02:00
# Example
```example
$ [a, b/2] $
$ lr(]sum_(x=1)^n] x, size: #50%) $
$ abs((x + y) / 2) $
```
- name: calc
2023-11-23 16:25:49 +01:00
title: Calculation
2023-09-11 15:53:20 +02:00
category: foundations
path: ["calc"]
2023-11-23 16:25:49 +01:00
details: |
2023-10-29 19:35:44 +01:00
Module for calculations and processing of numeric values.
2023-09-11 15:53:20 +02:00
2023-10-29 19:35:44 +01:00
These definitions are part of the `calc` module and not imported by default.
2023-09-11 15:53:20 +02:00
In addition to the functions listed below, the `calc` module also defines
the constants `pi`, `tau`, `e`, `inf`, and `nan`.
2023-10-29 19:35:44 +01:00
- name: sys
2023-11-23 16:25:49 +01:00
title: System
2023-10-29 19:35:44 +01:00
category: foundations
path: ["sys"]
2023-11-23 16:25:49 +01:00
details: |
2023-10-29 19:35:44 +01:00
Module for system interactions.
2023-12-18 12:18:41 +01:00
This module defines the following items:
- The `sys.version` constant (of type [`version`]) that specifies
2023-12-18 12:18:41 +01:00
the currently active Typst compiler version.
- The `sys.inputs` [dictionary], which makes external inputs
2023-12-18 12:18:41 +01:00
available to the project. An input specified in the command line as
`--input key=value` becomes available under `sys.inputs.key` as
`{"value"}`. To include spaces in the value, it may be enclosed with
single or double quotes.
The value is always of type [string]($str). More complex data
may be parsed manually using functions like [`json.decode`]($json.decode).
2023-11-23 16:25:49 +01:00
- name: sym
title: General
category: symbols
path: ["sym"]
details: |
Named general symbols.
For example, `#sym.arrow` produces the → symbol. Within
[formulas]($category/math), these symbols can be used without the `#sym.`
prefix.
The `d` in an integral's `dx` can be written as `[$dif x$]`.
Outside math formulas, `dif` can be accessed as `math.dif`.
- name: emoji
title: Emoji
category: symbols
path: ["emoji"]
details: |
Named emoji.
For example, `#emoji.face` produces the 😀 emoji. If you frequently use
certain emojis, you can also import them from the `emoji` module (`[#import
emoji: face]`) to use them without the `#emoji.` prefix.