feat: initial commit
This commit is contained in:
commit
b802ff49ab
454 files changed
+52429
No files matched your search
@@ -0,0 +1,67 @@
|
||||
# Bibliography
|
||||
|
||||
# bibliography
|
||||
|
||||
A bibliography / reference listing.
|
||||
|
||||
You can create a new bibliography by calling this function with a path to a bibliography file in either one of two formats:
|
||||
|
||||
- A Hayagriva `.yaml`/`.yml` file. Hayagriva is a new bibliography file format designed for use with Typst. Visit its [documentation](https://github.com/typst/hayagriva/blob/main/docs/file-format.md) for more details.
|
||||
- A BibLaTeX `.bib` file.
|
||||
|
||||
As soon as you add a bibliography somewhere in your document, you can start citing things with reference syntax (`@key`) or explicit calls to the [citation](/docs/reference/model/cite/) function (`#cite(<key>)`). The bibliography will only show entries for works that were referenced in the document.
|
||||
|
||||
## Styles
|
||||
|
||||
Typst offers a wide selection of built-in [citation and bibliography styles](/docs/reference/model/bibliography/#parameters-style). Beyond those, you can add and use custom [CSL](https://citationstyles.org/) (Citation Style Language) files. Wondering which style to use? Here are some good defaults based on what discipline you're working in:
|
||||
|
||||
| Fields | Typical Styles |
|
||||
| --- | --- |
|
||||
| Engineering, IT | `"ieee"` |
|
||||
| Psychology, Life Sciences | `"apa"` |
|
||||
| Social sciences | `"chicago-author-date"` |
|
||||
| Humanities | `"mla"`, `"chicago-notes"`, `"harvard-cite-them-right"` |
|
||||
| Economics | `"harvard-cite-them-right"` |
|
||||
| Physics | `"american-physics-society"` |
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
This was already noted by
|
||||
pirates long ago. @arrgh
|
||||
|
||||
Multiple sources say ...
|
||||
@arrgh @netwok.
|
||||
|
||||
#bibliography("works.bib")
|
||||
```
|
||||
|
||||
```typst
|
||||
#bibliography(
|
||||
sources,
|
||||
title: none | auto | content,
|
||||
full: bool,
|
||||
style: str | bytes
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- sources:
|
||||
- description: One or multiple paths to or raw bytes for Hayagriva `.yaml` and/or BibLaTeX `.bib` files. This can be a: - A path string to load a bibliography file from the given path. For more details about paths, see the [Paths section](/docs/reference/syntax/#paths). - Raw bytes from which the bibliography should be decoded. - An array where each item is one of the above.
|
||||
- type: str | bytes | array
|
||||
- default: None
|
||||
- title:
|
||||
- description: The title of the bibliography. - When set to `auto`, an appropriate title for the [text language](/docs/reference/text/text/#parameters-lang) will be used. This is the default. - When set to `none`, the bibliography will not have a title. - A custom title can be set by passing content. The bibliography\'s heading will not be numbered by default, but you can force it to be with a show-set rule: `show bibliography: set heading(numbering: "1.")`
|
||||
- type: none | auto | content
|
||||
- default: auto
|
||||
- full:
|
||||
- description: Whether to include all works from the given bibliography files, even those that weren\'t cited in the document. To selectively add individual cited works without showing them, you can also use the `cite` function with [`form`](/docs/reference/model/cite/#parameters-form) set to `none`.
|
||||
- type: bool
|
||||
- default: false
|
||||
- style:
|
||||
- description: The bibliography style. This can be: - A string with the name of one of the built-in styles (see below). Some of the styles listed below appear twice, once with their full name and once with a short alias. - A path string to a [CSL file](https://citationstyles.org/). For more details about paths, see the [Paths section](/docs/reference/syntax/#paths). - Raw bytes from which a CSL style should be decoded.
|
||||
- type: str | bytes
|
||||
- default: "ieee"
|
||||
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
# Cite
|
||||
|
||||
# cite
|
||||
|
||||
Cite a work from the bibliography.
|
||||
|
||||
Before you starting citing, you need to add a [bibliography](/docs/reference/model/bibliography/) somewhere in your document.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
This was already noted by
|
||||
pirates long ago. @arrgh
|
||||
|
||||
Multiple sources say ...
|
||||
@arrgh @netwok.
|
||||
|
||||
You can also call `cite`
|
||||
explicitly. #cite(<arrgh>)
|
||||
|
||||
#bibliography("works.bib")
|
||||
```
|
||||
|
||||
If your source name contains certain characters such as slashes, which are not recognized by the `<>` syntax, you can explicitly call `label` instead.
|
||||
|
||||
```typst
|
||||
Computer Modern is an example of a modernist serif typeface.
|
||||
#cite(label("DBLP:books/lib/Knuth86a")).
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This function indirectly has dedicated syntax. [References](/docs/reference/model/ref/) can be used to cite works from the bibliography. The label then corresponds to the citation key.
|
||||
|
||||
```typst
|
||||
#cite(
|
||||
key,
|
||||
supplement: none | content,
|
||||
form: none | str,
|
||||
style: auto | str | bytes
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- key:
|
||||
- description: The citation key that identifies the entry in the bibliography that shall be cited, as a label. ```typst // All the same @netwok \\ #cite(<netwok>) \\ #cite(label("netwok")) ```
|
||||
- type: label
|
||||
- default: None
|
||||
- supplement:
|
||||
- description: A supplement for the citation such as page or chapter number. In reference syntax, the supplement can be added in square brackets: ```typst This has been proven. @distress[p.~7] #bibliography("works.bib") ```
|
||||
- type: none | content
|
||||
- default: none
|
||||
- form:
|
||||
- description: The kind of citation to produce. Different forms are useful in different scenarios: A normal citation is useful as a source at the end of a sentence, while a "prose" citation is more suitable for inclusion in the flow of text. If set to `none`, the cited work is included in the bibliography, but nothing will be displayed. ```typst #cite(<netwok>, form: "prose") show the outsized effects of pirate life on the human psyche. ```
|
||||
- type: none | str
|
||||
- default: "normal"
|
||||
- style:
|
||||
- description: The citation style. This can be: - `auto` to automatically use the [bibliography\'s style](/docs/reference/model/bibliography/#parameters-style) for citations. - A string with the name of one of the built-in styles (see below). Some of the styles listed below appear twice, once with their full name and once with a short alias. - A path string to a [CSL file](https://citationstyles.org/). For more details about paths, see the [Paths section](/docs/reference/syntax/#paths). - Raw bytes from which a CSL style should be decoded.
|
||||
- type: auto | str | bytes
|
||||
- default: auto
|
||||
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
# Document
|
||||
|
||||
# document
|
||||
|
||||
The root element of a document and its metadata.
|
||||
|
||||
All documents are automatically wrapped in a `document` element. You cannot create a document element yourself. This function is only used with [set rules](/docs/reference/styling/#set-rules) to specify document metadata. Such a set rule must not occur inside of any layout container.
|
||||
|
||||
```typst
|
||||
#set document(title: [Hello])
|
||||
|
||||
This has no visible output, but
|
||||
embeds metadata into the PDF!
|
||||
```
|
||||
|
||||
Note that metadata set with this function is not rendered within the document. Instead, it is embedded in the compiled PDF file.
|
||||
|
||||
```typst
|
||||
#document(
|
||||
title: none | content,
|
||||
author: str | array,
|
||||
description: none | content,
|
||||
keywords: str | array,
|
||||
date: none | auto | datetime
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- title:
|
||||
- description: The document\'s title. This is rendered as the title of the PDF viewer window or the browser tab of the page. Adding a title is important for accessibility, as it makes it easier to navigate to your document and identify it among other open documents. When exporting to PDF/UA, a title is required. While this can be arbitrary content, PDF viewers only support plain text titles, so the conversion might be lossy.
|
||||
- type: none | content
|
||||
- default: none
|
||||
- author:
|
||||
- description: The document\'s authors.
|
||||
- type: str | array
|
||||
- default: ()
|
||||
- description:
|
||||
- description: The document\'s description.
|
||||
- type: none | content
|
||||
- default: none
|
||||
- keywords:
|
||||
- description: The document\'s keywords.
|
||||
- type: str | array
|
||||
- default: ()
|
||||
- date:
|
||||
- description: The document\'s creation date. If this is `auto` (default), Typst uses the current date and time. Setting it to `none` prevents Typst from embedding any creation date into the PDF metadata. The year component must be at least zero in order to be embedded into a PDF. If you want to create byte-by-byte reproducible PDFs, set this to something other than `auto`.
|
||||
- type: none | auto | datetime
|
||||
- default: auto
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# Emphasis
|
||||
|
||||
# emph
|
||||
|
||||
Emphasizes content by toggling italics.
|
||||
|
||||
- If the current [text style](/docs/reference/text/text/#parameters-style) is `"normal"`, this turns it into `"italic"`.
|
||||
- If it is already `"italic"` or `"oblique"`, it turns it back to `"normal"`.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
This is _emphasized._ \
|
||||
This is #emph[too.]
|
||||
|
||||
#show emph: it => {
|
||||
text(blue, it.body)
|
||||
}
|
||||
|
||||
This is _emphasized_ differently.
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This function also has dedicated syntax: To emphasize content, simply enclose it in underscores (`_`). Note that this only works at word boundaries. To emphasize part of a word, you have to use the function.
|
||||
|
||||
```typst
|
||||
#emph(
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- body:
|
||||
- description: The content to emphasize.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,141 @@
|
||||
# Numbered List
|
||||
|
||||
# enum
|
||||
|
||||
A numbered list.
|
||||
|
||||
Displays a sequence of items vertically and numbers them consecutively.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
Automatically numbered:
|
||||
+ Preparations
|
||||
+ Analysis
|
||||
+ Conclusions
|
||||
|
||||
Manually numbered:
|
||||
2. What is the first step?
|
||||
5. I am confused.
|
||||
+ Moving on ...
|
||||
|
||||
Multiple lines:
|
||||
+ This enum item has multiple
|
||||
lines because the next line
|
||||
is indented.
|
||||
|
||||
Function call.
|
||||
#enum[First][Second]
|
||||
```
|
||||
|
||||
You can easily switch all your enumerations to a different numbering style with a set rule.
|
||||
|
||||
```typst
|
||||
#set enum(numbering: "a)")
|
||||
|
||||
+ Starting off ...
|
||||
+ Don't forget step two
|
||||
```
|
||||
|
||||
You can also use [`enum.item`](/docs/reference/model/enum/#definitions-item) to programmatically customize the number of each item in the enumeration:
|
||||
|
||||
```typst
|
||||
#enum(
|
||||
enum.item(1)[First step],
|
||||
enum.item(5)[Fifth step],
|
||||
enum.item(10)[Tenth step]
|
||||
)
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This functions also has dedicated syntax:
|
||||
|
||||
- Starting a line with a plus sign creates an automatically numbered enumeration item.
|
||||
- Starting a line with a number followed by a dot creates an explicitly numbered enumeration item.
|
||||
|
||||
Enumeration items can contain multiple paragraphs and other block-level content. All content that is indented more than an item's marker becomes part of that item.
|
||||
|
||||
```typst
|
||||
#enum(
|
||||
tight: bool,
|
||||
numbering: str | function,
|
||||
start: auto | int,
|
||||
full: bool,
|
||||
reversed: bool,
|
||||
indent: length,
|
||||
body-indent: length,
|
||||
spacing: auto | length,
|
||||
number-align: alignment,
|
||||
children
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- tight:
|
||||
- description: Defines the default [spacing](/docs/reference/model/enum/#parameters-spacing) of the enumeration. If it is `false`, the items are spaced apart with [paragraph spacing](/docs/reference/model/par/#parameters-spacing). If it is `true`, they use [paragraph leading](/docs/reference/model/par/#parameters-leading) instead. This makes the list more compact, which can look better if the items are short. In markup mode, the value of this parameter is determined based on whether items are separated with a blank line. If items directly follow each other, this is set to `true`; if items are separated by a blank line, this is set to `false`. The markup-defined tightness cannot be overridden with set rules. ```typst + If an enum has a lot of text, and maybe other inline content, it should not be tight anymore. + To make an enum wide, simply insert a blank line between the items. ```
|
||||
- type: bool
|
||||
- default: true
|
||||
- numbering:
|
||||
- description: How to number the enumeration. Accepts a [numbering pattern or function](/docs/reference/model/numbering/). If the numbering pattern contains multiple counting symbols, they apply to nested enums. If given a function, the function receives one argument if `full` is `false` and multiple arguments if `full` is `true`. ```typst #set enum(numbering: "1.a)") + Different + Numbering + Nested + Items + Style #set enum(numbering: n => super[#n]) + Superscript + Numbering! ```
|
||||
- type: str | function
|
||||
- default: "1."
|
||||
- start:
|
||||
- description: Which number to start the enumeration with. ```typst #enum( start: 3, [Skipping], [Ahead], ) ```
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- full:
|
||||
- description: Whether to display the full numbering, including the numbers of all parent enumerations. ```typst #set enum(numbering: "1.a)", full: true) + Cook + Heat water + Add ingredients + Eat ```
|
||||
- type: bool
|
||||
- default: false
|
||||
- reversed:
|
||||
- description: Whether to reverse the numbering for this enumeration. ```typst #set enum(reversed: true) + Coffee + Tea + Milk ```
|
||||
- type: bool
|
||||
- default: false
|
||||
- indent:
|
||||
- description: The indentation of each item.
|
||||
- type: length
|
||||
- default: 0pt
|
||||
- body-indent:
|
||||
- description: The space between the numbering and the body of each item.
|
||||
- type: length
|
||||
- default: 0.5em
|
||||
- spacing:
|
||||
- description: The spacing between the items of the enumeration. If set to `auto`, uses paragraph [`leading`](/docs/reference/model/par/#parameters-leading) for tight enumerations and paragraph [`spacing`](/docs/reference/model/par/#parameters-spacing) for wide (non-tight) enumerations.
|
||||
- type: auto | length
|
||||
- default: auto
|
||||
- number-align:
|
||||
- description: The alignment that enum numbers should have. By default, this is set to `end + top`, which aligns enum numbers towards end of the current text direction (in left-to-right script, for example, this is the same as `right`) and at the top of the line. The choice of `end` for horizontal alignment of enum numbers is usually preferred over `start`, as numbers then grow away from the text instead of towards it, avoiding certain visual issues. This option lets you override this behaviour, however. (Also to note is that the [unordered list](/docs/reference/model/list/) uses a different method for this, by giving the `marker` content an alignment directly.). ```typst #set enum(number-align: start + bottom) Here are some powers of two: 1. One 2. Two 4. Four 8. Eight 16. Sixteen 32. Thirty two ```
|
||||
- type: alignment
|
||||
- default: end + top
|
||||
- children:
|
||||
- description: The numbered list\'s items. When using the enum syntax, adjacent items are automatically collected into enumerations, even through constructs like for loops. ```typst #for phase in ( "Launch", "Orbit", "Descent", ) [+ #phase] ```
|
||||
- type: content | array
|
||||
- default: None
|
||||
|
||||
|
||||
## Definitions
|
||||
### enum.item
|
||||
|
||||
An enumeration item.
|
||||
|
||||
```typst
|
||||
#enum.item(
|
||||
number,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- number:
|
||||
- description: The item\'s number.
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- body:
|
||||
- description: The item\'s body.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
# Figure
|
||||
|
||||
# figure
|
||||
|
||||
A figure with an optional caption.
|
||||
|
||||
Automatically detects its kind to select the correct counting track. For example, figures containing images will be numbered separately from figures containing tables.
|
||||
|
||||
## Examples
|
||||
|
||||
The example below shows a basic figure with an image:
|
||||
|
||||
```typst
|
||||
@glacier shows a glacier. Glaciers
|
||||
are complex systems.
|
||||
|
||||
#figure(
|
||||
image("glacier.jpg", width: 80%),
|
||||
caption: [A curious figure.],
|
||||
) <glacier>
|
||||
```
|
||||
|
||||
You can also insert [tables](/docs/reference/model/table/) into figures to give them a caption. The figure will detect this and automatically use a separate counter.
|
||||
|
||||
```typst
|
||||
#figure(
|
||||
table(
|
||||
columns: 4,
|
||||
[t], [1], [2], [3],
|
||||
[y], [0.3s], [0.4s], [0.8s],
|
||||
),
|
||||
caption: [Timing results],
|
||||
)
|
||||
```
|
||||
|
||||
This behaviour can be overridden by explicitly specifying the figure's `kind`. All figures of the same kind share a common counter.
|
||||
|
||||
## Figure behaviour
|
||||
|
||||
By default, figures are placed within the flow of content. To make them float to the top or bottom of the page, you can use the [`placement`](/docs/reference/model/figure/#parameters-placement) argument.
|
||||
|
||||
If your figure is too large and its contents are breakable across pages (e.g. if it contains a large table), then you can make the figure itself breakable across pages as well with this show rule:
|
||||
|
||||
```typst
|
||||
#show figure: set block(breakable: true)
|
||||
```
|
||||
|
||||
See the [block](/docs/reference/layout/block/#parameters-breakable) documentation for more information about breakable and non-breakable blocks.
|
||||
|
||||
## Caption customization
|
||||
|
||||
You can modify the appearance of the figure's caption with its associated [`caption`](/docs/reference/model/figure/#definitions-caption) function. In the example below, we emphasize all captions:
|
||||
|
||||
```typst
|
||||
#show figure.caption: emph
|
||||
|
||||
#figure(
|
||||
rect[Hello],
|
||||
caption: [I am emphasized!],
|
||||
)
|
||||
```
|
||||
|
||||
By using a [`where`](/docs/reference/foundations/function/#definitions-where) selector, we can scope such rules to specific kinds of figures. For example, to position the caption above tables, but keep it below for all other kinds of figures, we could write the following show-set rule:
|
||||
|
||||
```typst
|
||||
#show figure.where(
|
||||
kind: table
|
||||
): set figure.caption(position: top)
|
||||
|
||||
#figure(
|
||||
table(columns: 2)[A][B][C][D],
|
||||
caption: [I'm up here],
|
||||
)
|
||||
```
|
||||
|
||||
## Accessibility
|
||||
|
||||
You can use the [`alt`](/docs/reference/model/figure/#parameters-alt) parameter to provide an [alternative description](/docs/guides/accessibility/#textual-representations) of the figure for screen readers and other Assistive Technology (AT). Refer to [its documentation](/docs/reference/model/figure/#parameters-alt) to learn more.
|
||||
|
||||
You can use figures to add alternative descriptions to paths, shapes, or visualizations that do not have their own `alt` parameter. If your graphic is purely decorative and does not have a semantic meaning, consider wrapping it in [`pdf.artifact`](/docs/reference/pdf/artifact/) instead, which will hide it from AT when exporting to PDF.
|
||||
|
||||
AT will always read the figure at the point where it appears in the document, regardless of its [`placement`](/docs/reference/model/figure/#parameters-placement). Put its markup where it would make the most sense in the reading order.
|
||||
|
||||
```typst
|
||||
#figure(
|
||||
body,
|
||||
alt: none | str,
|
||||
placement: none | auto | alignment,
|
||||
scope: str,
|
||||
caption: none | content,
|
||||
kind: auto | str | function,
|
||||
supplement: none | auto | content | function,
|
||||
numbering: none | str | function,
|
||||
gap: length,
|
||||
outlined: bool
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- body:
|
||||
- description: The content of the figure. Often, an [image](/docs/reference/visualize/image/).
|
||||
- type: content
|
||||
- default: None
|
||||
- alt:
|
||||
- description: An alternative description of the figure. When you add an alternative description, AT will read both it and the caption (if any). However, the content of the figure itself will be skipped. When the body of your figure is an [image](/docs/reference/visualize/image/) with its own `alt` text set, this parameter should not be used on the figure element. Likewise, do not use this parameter when the figure contains a table, code, or other content that is already accessible. In such cases, the content of the figure will be read by AT, and adding an alternative description would lead to a loss of information. You can learn how to write good alternative descriptions in the [Accessibility Guide](/docs/guides/accessibility/#textual-representations).
|
||||
- type: none | str
|
||||
- default: none
|
||||
- placement:
|
||||
- description: The figure\'s placement on the page. - `none`: The figure stays in-flow exactly where it was specified like other content. - `auto`: The figure picks `top` or `bottom` depending on which is closer. - `top`: The figure floats to the top of the page. - `bottom`: The figure floats to the bottom of the page. The gap between the main flow content and the floating figure is controlled by the [`clearance`](/docs/reference/layout/place/#parameters-clearance) argument on the `place` function. ```typst #set page(height: 200pt) #show figure: set place( clearance: 1em, ) = Introduction #figure( placement: bottom, caption: [A glacier], image("glacier.jpg", width: 60%), ) #lorem(60) ```
|
||||
- type: none | auto | alignment
|
||||
- default: none
|
||||
- scope:
|
||||
- description: Relative to which containing scope the figure is placed. Set this to `"parent"` to create a full-width figure in a two-column document. Has no effect if `placement` is `none`. ```typst #set page(height: 250pt, columns: 2) = Introduction #figure( placement: bottom, scope: "parent", caption: [A glacier], image("glacier.jpg", width: 60%), ) #lorem(60) ```
|
||||
- type: str
|
||||
- default: "column"
|
||||
- caption:
|
||||
- description: The figure\'s caption.
|
||||
- type: none | content
|
||||
- default: none
|
||||
- kind:
|
||||
- description: The kind of figure this is. All figures of the same kind share a common counter. If set to `auto`, the figure will try to automatically determine its kind based on the type of its body. Automatically detected kinds are [tables](/docs/reference/model/table/) and [code](/docs/reference/text/raw/). In other cases, the inferred kind is that of an [image](/docs/reference/visualize/image/). Setting this to something other than `auto` will override the automatic detection. This can be useful if - you wish to create a custom figure type that is not an [image](/docs/reference/visualize/image/), a [table](/docs/reference/model/table/) or [code](/docs/reference/text/raw/), - you want to force the figure to use a specific counter regardless of its content. You can set the kind to be an element function or a string. If you set it to an element function other than [`table`](/docs/reference/model/table/), [`raw`](/docs/reference/text/raw/), or [`image`](/docs/reference/visualize/image/), you will need to manually specify the figure\'s supplement. ```typst #figure( circle(radius: 10pt), caption: [A curious atom.], kind: "atom", supplement: [Atom], ) ``` If you want to modify a counter to skip a number or reset the counter, you can access the [counter](/docs/reference/introspection/counter/) of each kind of figure with a [`where`](/docs/reference/foundations/function/#definitions-where) selector: - For [tables](/docs/reference/model/table/): `counter(figure.where(kind: table))` - For [images](/docs/reference/visualize/image/): `counter(figure.where(kind: image))` - For a custom kind: `counter(figure.where(kind: kind))` ```typst #figure( table(columns: 2, $n$, $1$), caption: [The first table.], ) #counter( figure.where(kind: table) ).update(41) #figure( table(columns: 2, $n$, $42$), caption: [The 42nd table], ) #figure( rect[Image], caption: [Does not affect images], ) ``` To conveniently use the correct counter in a show rule, you can access the `counter` field. There is an example of this in the documentation [of the `figure.caption` element\'s `body` field](/docs/reference/model/figure/#definitions-caption-body).
|
||||
- type: auto | str | function
|
||||
- default: auto
|
||||
- supplement:
|
||||
- description: The figure\'s supplement. If set to `auto`, the figure will try to automatically determine the correct supplement based on the `kind` and the active [text language](/docs/reference/text/text/#parameters-lang). If you are using a custom figure type, you will need to manually specify the supplement. If a function is specified, it is passed the first descendant of the specified `kind` (typically, the figure\'s body) and should return content. ```typst #figure( [The contents of my figure!], caption: [My custom figure], supplement: [Bar], kind: "foo", ) ```
|
||||
- type: none | auto | content | function
|
||||
- default: auto
|
||||
- numbering:
|
||||
- description: How to number the figure. Accepts a [numbering pattern or function](/docs/reference/model/numbering/) taking a single number.
|
||||
- type: none | str | function
|
||||
- default: "1"
|
||||
- gap:
|
||||
- description: The vertical gap between the body and caption.
|
||||
- type: length
|
||||
- default: 0.65em
|
||||
- outlined:
|
||||
- description: Whether the figure should appear in an [`outline`](/docs/reference/model/outline/) of figures.
|
||||
- type: bool
|
||||
- default: true
|
||||
|
||||
|
||||
## Definitions
|
||||
### figure.caption
|
||||
|
||||
The caption of a figure. This element can be used in set and show rules to customize the appearance of captions for all figures or figures of a specific kind.
|
||||
|
||||
In addition to its `position` and `body`, the `caption` also provides the figure's `kind`, `supplement`, `counter`, and `numbering` as fields. These parts can be used in [`where`](/docs/reference/foundations/function/#definitions-where) selectors and show rules to build a completely custom caption.
|
||||
|
||||
```typst
|
||||
#show figure.caption: emph
|
||||
|
||||
#figure(
|
||||
rect[Hello],
|
||||
caption: [A rectangle],
|
||||
)
|
||||
```
|
||||
|
||||
```typst
|
||||
#figure.caption(
|
||||
position: alignment,
|
||||
separator: auto | content,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- position:
|
||||
- description: The caption\'s position in the figure. Either `top` or `bottom`. ```typst #show figure.where( kind: table ): set figure.caption(position: top) #figure( table(columns: 2)[A][B], caption: [I\'m up here], ) #figure( rect[Hi], caption: [I\'m down here], ) #figure( table(columns: 2)[A][B], caption: figure.caption( position: bottom, [I\'m down here too!] ) ) ```
|
||||
- type: alignment
|
||||
- default: bottom
|
||||
- separator:
|
||||
- description: The separator which will appear between the number and body. If set to `auto`, the separator will be adapted to the current [language](/docs/reference/text/text/#parameters-lang) and [region](/docs/reference/text/text/#parameters-region). ```typst #set figure.caption(separator: [ --- ]) #figure( rect[Hello], caption: [A rectangle], ) ```
|
||||
- type: auto | content
|
||||
- default: auto
|
||||
- body:
|
||||
- description: The caption\'s body. Can be used alongside `kind`, `supplement`, `counter`, `numbering`, and `location` to completely customize the caption. ```typst #show figure.caption: it => [ #underline(it.body) | #it.supplement #context it.counter.display(it.numbering) ] #figure( rect[Hello], caption: [A rectangle], ) ```
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
# Footnote
|
||||
|
||||
# footnote
|
||||
|
||||
A footnote.
|
||||
|
||||
Includes additional remarks and references on the same page with footnotes. A footnote will insert a superscript number that links to the note at the bottom of the page. Notes are numbered sequentially throughout your document and can break across multiple pages.
|
||||
|
||||
To customize the appearance of the entry in the footnote listing, see [`footnote.entry`](/docs/reference/model/footnote/#definitions-entry). The footnote itself is realized as a normal superscript, so you can use a set rule on the [`super`](/docs/reference/text/super/) function to customize it. You can also apply a show rule to customize only the footnote marker (superscript number) in the running text.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
Check the docs for more details.
|
||||
#footnote[https://typst.app/docs]
|
||||
```
|
||||
|
||||
The footnote automatically attaches itself to the preceding word, even if there is a space before it in the markup. To force space, you can use the string `#" "` or explicit [horizontal spacing](/docs/reference/layout/h/).
|
||||
|
||||
By giving a label to a footnote, you can have multiple references to it.
|
||||
|
||||
```typst
|
||||
You can edit Typst documents online.
|
||||
#footnote[https://typst.app/app] <fn>
|
||||
Checkout Typst's website. @fn
|
||||
And the online app. #footnote(<fn>)
|
||||
```
|
||||
|
||||
_Note:_ Set and show rules in the scope where `footnote` is called may not apply to the footnote's content. See [here](https://github.com/typst/typst/issues/1467#issuecomment-1588799440) for more information.
|
||||
|
||||
## Accessibility
|
||||
|
||||
Footnotes will be read by Assistive Technology (AT) immediately after the spot in the text where they are referenced, just like how they appear in markup.
|
||||
|
||||
```typst
|
||||
#footnote(
|
||||
numbering: str | function,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- numbering:
|
||||
- description: How to number footnotes. Accepts a [numbering pattern or function](/docs/reference/model/numbering/) taking a single number. By default, the footnote numbering continues throughout your document. If you prefer per-page footnote numbering, you can reset the footnote [counter](/docs/reference/introspection/counter/) in the page [header](/docs/reference/layout/page/#parameters-header). In the future, there might be a simpler way to achieve this. ```typst #set footnote(numbering: "*") Footnotes: #footnote[Star], #footnote[Dagger] ```
|
||||
- type: str | function
|
||||
- default: "1"
|
||||
- body:
|
||||
- description: The content to put into the footnote. Can also be the label of another footnote this one should point to.
|
||||
- type: label | content
|
||||
- default: None
|
||||
|
||||
|
||||
## Definitions
|
||||
### footnote.entry
|
||||
|
||||
An entry in a footnote list.
|
||||
|
||||
This function is not intended to be called directly. Instead, it is used in set and show rules to customize footnote listings.
|
||||
|
||||
```typst
|
||||
#show footnote.entry: set text(red)
|
||||
|
||||
My footnote listing
|
||||
#footnote[It's down here]
|
||||
has red text!
|
||||
```
|
||||
|
||||
_Note:_ Footnote entry properties must be uniform across each page run (a page run is a sequence of pages without an explicit pagebreak in between). For this reason, set and show rules for footnote entries should be defined before any page content, typically at the very start of the document.
|
||||
|
||||
```typst
|
||||
#footnote.entry(
|
||||
note,
|
||||
separator: content,
|
||||
clearance: length,
|
||||
gap: length,
|
||||
indent: length
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- note:
|
||||
- description: The footnote for this entry. Its location can be used to determine the footnote counter state. ```typst #show footnote.entry: it => { let loc = it.note.location() numbering( "1: ", ..counter(footnote).at(loc), ) it.note.body } Customized #footnote[Hello] listing #footnote[World! 🌏] ```
|
||||
- type: content
|
||||
- default: None
|
||||
- separator:
|
||||
- description: The separator between the document body and the footnote listing. ```typst #set footnote.entry( separator: repeat[.] ) Testing a different separator. #footnote[ Unconventional, but maybe not that bad? ] ```
|
||||
- type: content
|
||||
- default: line (length : 30 % + 0pt, stroke : 0.5pt)
|
||||
- clearance:
|
||||
- description: The amount of clearance between the document body and the separator. ```typst #set footnote.entry(clearance: 3em) Footnotes also need ... #footnote[ ... some space to breathe. ] ```
|
||||
- type: length
|
||||
- default: 1em
|
||||
- gap:
|
||||
- description: The gap between footnote entries. ```typst #set footnote.entry(gap: 0.8em) Footnotes: #footnote[Spaced], #footnote[Apart] ```
|
||||
- type: length
|
||||
- default: 0.5em
|
||||
- indent:
|
||||
- description: The indent of each footnote entry. ```typst #set footnote.entry(indent: 0em) Footnotes: #footnote[No], #footnote[Indent] ```
|
||||
- type: length
|
||||
- default: 1em
|
||||
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
# Heading
|
||||
|
||||
# heading
|
||||
|
||||
A section heading.
|
||||
|
||||
With headings, you can structure your document into sections. Each heading has a _level,_ which starts at one and is unbounded upwards. This level indicates the logical role of the following content (section, subsection, etc.) A top-level heading indicates a top-level section of the document (not the document's title). To insert a title, use the [`title`](/docs/reference/model/title/) element instead.
|
||||
|
||||
Typst can automatically number your headings for you. To enable numbering, specify how you want your headings to be numbered with a [numbering pattern or function](/docs/reference/model/numbering/).
|
||||
|
||||
Independently of the numbering, Typst can also automatically generate an [outline](/docs/reference/model/outline/) of all headings for you. To exclude one or more headings from this outline, you can set the `outlined` parameter to `false`.
|
||||
|
||||
When writing a [show rule](/docs/reference/styling/#show-rules) that accesses the [`body` field](/docs/reference/model/heading/#parameters-body) to create a completely custom look for headings, make sure to wrap the content in a [`block`](/docs/reference/layout/block/) (which is implicitly [sticky](/docs/reference/layout/block/#parameters-sticky) for headings through a built-in show-set rule). This prevents headings from becoming "orphans", i.e. remaining at the end of the page with the following content being on the next page.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#set heading(numbering: "1.a)")
|
||||
|
||||
= Introduction
|
||||
In recent years, ...
|
||||
|
||||
== Preliminaries
|
||||
To start, ...
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
Headings have dedicated syntax: They can be created by starting a line with one or multiple equals signs, followed by a space. The number of equals signs determines the heading's logical nesting depth. The `offset` field can be set to configure the starting depth.
|
||||
|
||||
## Accessibility
|
||||
|
||||
Headings are important for accessibility, as they help users of Assistive Technologies (AT) like screen readers to navigate within your document. Screen reader users will be able to skip from heading to heading, or get an overview of all headings in the document.
|
||||
|
||||
To make your headings accessible, you should not skip heading levels. This means that you should start with a first-level heading. Also, when the previous heading was of level 3, the next heading should be of level 3 (staying at the same depth), level 4 (going exactly one level deeper), or level 1 or 2 (new hierarchically higher headings).
|
||||
|
||||
## HTML export
|
||||
|
||||
As mentioned above, a top-level heading indicates a top-level section of the document rather than its title. This is in contrast to the HTML `<h1>` element of which there should be only one per document.
|
||||
|
||||
For this reason, in HTML export, a [`title`](/docs/reference/model/title/) element will turn into an `<h1>` and headings turn into `<h2>` and lower (a level 1 heading thus turns into `<h2>`, a level 2 heading into `<h3>`, etc).
|
||||
|
||||
```typst
|
||||
#heading(
|
||||
level: auto | int,
|
||||
depth: int,
|
||||
offset: int,
|
||||
numbering: none | str | function,
|
||||
supplement: none | auto | content | function,
|
||||
outlined: bool,
|
||||
bookmarked: auto | bool,
|
||||
hanging-indent: auto | length,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- level:
|
||||
- description: The absolute nesting depth of the heading, starting from one. If set to `auto`, it is computed from `offset + depth`. This is primarily useful for usage in [show rules](/docs/reference/styling/#show-rules) (either with [`where`](/docs/reference/foundations/function/#definitions-where) selectors or by accessing the level directly on a shown heading). ```typst #show heading.where(level: 2): set text(red) = Level 1 == Level 2 #set heading(offset: 1) = Also level 2 == Level 3 ```
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- depth:
|
||||
- description: The relative nesting depth of the heading, starting from one. This is combined with `offset` to compute the actual `level`. This is set by the heading syntax, such that `== Heading` creates a heading with logical depth of 2, but actual level `offset + 2`. If you construct a heading manually, you should typically prefer this over setting the absolute level.
|
||||
- type: int
|
||||
- default: 1
|
||||
- offset:
|
||||
- description: The starting offset of each heading\'s `level`, used to turn its relative `depth` into its absolute `level`. ```typst = Level 1 #set heading(offset: 1, numbering: "1.1") = Level 2 #heading(offset: 2, depth: 2)[ I\'m level 4 ] ```
|
||||
- type: int
|
||||
- default: 0
|
||||
- numbering:
|
||||
- description: How to number the heading. Accepts a [numbering pattern or function](/docs/reference/model/numbering/) taking multiple numbers. ```typst #set heading(numbering: "1.a.") = A section == A subsection === A sub-subsection ```
|
||||
- type: none | str | function
|
||||
- default: none
|
||||
- supplement:
|
||||
- description: A supplement for the heading. For references to headings, this is added before the referenced number. If a function is specified, it is passed the referenced heading and should return content. ```typst #set heading(numbering: "1.", supplement: [Chapter]) = Introduction <intro> In @intro, we see how to turn Sections into Chapters. And in @intro[Part], it is done manually. ```
|
||||
- type: none | auto | content | function
|
||||
- default: auto
|
||||
- outlined:
|
||||
- description: Whether the heading should appear in the [outline](/docs/reference/model/outline/). Note that this property, if set to `true`, ensures the heading is also shown as a bookmark in the exported PDF\'s outline (when exporting to PDF). To change that behavior, use the `bookmarked` property. ```typst #outline() #heading[Normal] This is a normal heading. #heading(outlined: false)[Hidden] This heading does not appear in the outline. ```
|
||||
- type: bool
|
||||
- default: true
|
||||
- bookmarked:
|
||||
- description: Whether the heading should appear as a bookmark in the exported PDF\'s outline. Doesn\'t affect other export formats, such as PNG. The default value of `auto` indicates that the heading will only appear in the exported PDF\'s outline if its `outlined` property is set to `true`, that is, if it would also be listed in Typst\'s [outline](/docs/reference/model/outline/). Setting this property to either `true` (bookmark) or `false` (don\'t bookmark) bypasses that behavior. ```typst #heading[Normal heading] This heading will be shown in the PDF\'s bookmark outline. #heading(bookmarked: false)[Not bookmarked] This heading won\'t be bookmarked in the resulting PDF. ```
|
||||
- type: auto | bool
|
||||
- default: auto
|
||||
- hanging-indent:
|
||||
- description: The indent all but the first line of a heading should have. The default value of `auto` uses the width of the numbering as indent if the heading is aligned at the [start](/docs/reference/layout/direction/#definitions-start) of the [text direction](/docs/reference/text/text/#parameters-dir), and no indent for center and other alignments. ```typst #set heading(numbering: "1.") = A very, very, very, very, very, very long heading #show heading: set align(center) == A very long heading\\ with center alignment ```
|
||||
- type: auto | length
|
||||
- default: auto
|
||||
- body:
|
||||
- description: The heading\'s title.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Model
|
||||
|
||||
Document structuring.
|
||||
|
||||
Here, you can find functions to structure your document and interact with that structure. This includes section headings, figures, bibliography management, cross-referencing and more.
|
||||
|
||||
## Definitions
|
||||
|
||||
| Name | Description |
|
||||
| --- | --- |
|
||||
| [`bibliography`](/reference/model/bibliography/) | A bibliography / reference listing. |
|
||||
| [`cite`](/reference/model/cite/) | Cite a work from the bibliography. |
|
||||
| [`document`](/reference/model/document/) | The root element of a document and its metadata. |
|
||||
| [`emph`](/reference/model/emph/) | Emphasizes content by toggling italics. |
|
||||
| [`enum`](/reference/model/enum/) | A numbered list. |
|
||||
| [`figure`](/reference/model/figure/) | A figure with an optional caption. |
|
||||
| [`footnote`](/reference/model/footnote/) | A footnote. |
|
||||
| [`heading`](/reference/model/heading/) | A section heading. |
|
||||
| [`link`](/reference/model/link/) | Links to a URL or a location in the document. |
|
||||
| [`list`](/reference/model/list/) | A bullet list. |
|
||||
| [`numbering`](/reference/model/numbering/) | Applies a numbering to a sequence of numbers. |
|
||||
| [`outline`](/reference/model/outline/) | A table of contents, figures, or other elements. |
|
||||
| [`par`](/reference/model/par/) | A logical subdivison of textual content. |
|
||||
| [`parbreak`](/reference/model/parbreak/) | A paragraph break. |
|
||||
| [`quote`](/reference/model/quote/) | Displays a quote alongside an optional attribution. |
|
||||
| [`ref`](/reference/model/ref/) | A reference to a label or bibliography. |
|
||||
| [`strong`](/reference/model/strong/) | Strongly emphasizes content by increasing the font weight. |
|
||||
| [`table`](/reference/model/table/) | A table of items. |
|
||||
| [`terms`](/reference/model/terms/) | A list of terms and their descriptions. |
|
||||
| [`title`](/reference/model/title/) | A document title. |
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
# Link
|
||||
|
||||
# link
|
||||
|
||||
Links to a URL or a location in the document.
|
||||
|
||||
By default, links do not look any different from normal text. However, you can easily apply a style of your choice with a show rule.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#show link: underline
|
||||
|
||||
https://example.com \
|
||||
|
||||
#link("https://example.com") \
|
||||
#link("https://example.com")[
|
||||
See example.com
|
||||
]
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This function also has dedicated syntax: Text that starts with `http://` or `https://` is automatically turned into a link.
|
||||
|
||||
## Hyphenation
|
||||
|
||||
If you enable hyphenation or justification, by default, it will not apply to links to prevent unwanted hyphenation in URLs. You can opt out of this default via `show link: set text(hyphenate: true)`.
|
||||
|
||||
## Accessibility
|
||||
|
||||
The destination of a link should be clear from the link text itself, or at least from the text immediately surrounding it. In PDF export, Typst will automatically generate a tooltip description for links based on their destination. For links to URLs, the URL itself will be used as the tooltip.
|
||||
|
||||
## Links in HTML export
|
||||
|
||||
In HTML export, a link to a [label](/docs/reference/foundations/label/) or [location](/docs/reference/introspection/location/) will be turned into a fragment link to a named anchor point. To support this, targets without an existing ID will automatically receive an ID in the DOM. How this works varies by which kind of HTML node(s) the link target turned into:
|
||||
|
||||
- If the link target turned into a single HTML element, that element will receive the ID. This is, for instance, typically the case when linking to a top-level heading (which turns into a single `<h2>` element).
|
||||
- If the link target turned into a single text node, the node will be wrapped in a `<span>`, which will then receive the ID.
|
||||
- If the link target turned into multiple nodes, the first node will receive the ID.
|
||||
- If the link target turned into no nodes at all, an empty span will be generated to serve as a link target.
|
||||
|
||||
If you rely on a specific DOM structure, you should ensure that the link target turns into one or multiple elements, as the compiler makes no guarantees on the precise segmentation of text into text nodes.
|
||||
|
||||
If present, the automatic ID generation tries to reuse the link target's label to create a human-readable ID. A label can be reused if:
|
||||
|
||||
- All characters are alphabetic or numeric according to Unicode, or a hyphen, or an underscore.
|
||||
- The label does not start with a digit or hyphen.
|
||||
|
||||
These rules ensure that the label is both a valid CSS identifier and a valid URL fragment for linking.
|
||||
|
||||
As IDs must be unique in the DOM, duplicate labels might need disambiguation when reusing them as IDs. The precise rules for this are as follows:
|
||||
|
||||
- If a label can be reused and is unique in the document, it will directly be used as the ID.
|
||||
- If it's reusable, but not unique, a suffix consisting of a hyphen and an integer will be added. For instance, if the label `<mylabel>` exists twice, it would turn into `mylabel-1` and `mylabel-2`.
|
||||
- Otherwise, a unique ID of the form `loc-` followed by an integer will be generated.
|
||||
|
||||
```typst
|
||||
#link(
|
||||
dest,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- dest:
|
||||
- description: The destination the link points to. - To link to web pages, `dest` should be a valid URL string. If the URL is in the `mailto:` or `tel:` scheme and the `body` parameter is omitted, the email address or phone number will be the link\'s body, without the scheme. - To link to another part of the document, `dest` can take one of three forms: - A [label](/docs/reference/foundations/label/) attached to an element. If you also want automatic text for the link based on the element, consider using a [reference](/docs/reference/model/ref/) instead. - A [`location`](/docs/reference/introspection/location/) (typically retrieved from [`here`](/docs/reference/introspection/here/), [`locate`](/docs/reference/introspection/locate/) or [`query`](/docs/reference/introspection/query/)). - A dictionary with a `page` key of type [integer](/docs/reference/foundations/int/) and `x` and `y` coordinates of type [length](/docs/reference/layout/length/). Pages are counted from one, and the coordinates are relative to the page\'s top left corner. ```typst = Introduction <intro> #link("mailto:hello@typst.app") \\ #link(<intro>)[Go to intro] \\ #link((page: 1, x: 0pt, y: 0pt))[ Go to top ] ```
|
||||
- type: str | label | location | dictionary
|
||||
- default: None
|
||||
- body:
|
||||
- description: The content that should become a link. If `dest` is an URL string, the parameter can be omitted. In this case, the URL will be shown as the link.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
# Bullet List
|
||||
|
||||
# list
|
||||
|
||||
A bullet list.
|
||||
|
||||
Displays a sequence of items vertically, with each item introduced by a marker.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
Normal list.
|
||||
- Text
|
||||
- Math
|
||||
- Layout
|
||||
- ...
|
||||
|
||||
Multiple lines.
|
||||
- This list item spans multiple
|
||||
lines because it is indented.
|
||||
|
||||
Function call.
|
||||
#list(
|
||||
[Foundations],
|
||||
[Calculate],
|
||||
[Construct],
|
||||
[Data Loading],
|
||||
)
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This functions also has dedicated syntax: Start a line with a hyphen, followed by a space to create a list item. A list item can contain multiple paragraphs and other block-level content. All content that is indented more than an item's marker becomes part of that item.
|
||||
|
||||
```typst
|
||||
#list(
|
||||
tight: bool,
|
||||
marker: content | array | function,
|
||||
indent: length,
|
||||
body-indent: length,
|
||||
spacing: auto | length,
|
||||
children
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- tight:
|
||||
- description: Defines the default [spacing](/docs/reference/model/list/#parameters-spacing) of the list. If it is `false`, the items are spaced apart with [paragraph spacing](/docs/reference/model/par/#parameters-spacing). If it is `true`, they use [paragraph leading](/docs/reference/model/par/#parameters-leading) instead. This makes the list more compact, which can look better if the items are short. In markup mode, the value of this parameter is determined based on whether items are separated with a blank line. If items directly follow each other, this is set to `true`; if items are separated by a blank line, this is set to `false`. The markup-defined tightness cannot be overridden with set rules. ```typst - If a list has a lot of text, and maybe other inline content, it should not be tight anymore. - To make a list wide, simply insert a blank line between the items. ```
|
||||
- type: bool
|
||||
- default: true
|
||||
- marker:
|
||||
- description: The marker which introduces each item. Instead of plain content, you can also pass an array with multiple markers that should be used for nested lists. If the list nesting depth exceeds the number of markers, the markers are cycled. For total control, you may pass a function that maps the list\'s nesting depth (starting from `0`) to a desired marker. ```typst #set list(marker: [--]) - A more classic list - With en-dashes #set list(marker: ([•], [--])) - Top-level - Nested - Items - Items ```
|
||||
- type: content | array | function
|
||||
- default: ([•], [‣], [–])
|
||||
- indent:
|
||||
- description: The indent of each item.
|
||||
- type: length
|
||||
- default: 0pt
|
||||
- body-indent:
|
||||
- description: The spacing between the marker and the body of each item.
|
||||
- type: length
|
||||
- default: 0.5em
|
||||
- spacing:
|
||||
- description: The spacing between the items of the list. If set to `auto`, uses paragraph [`leading`](/docs/reference/model/par/#parameters-leading) for tight lists and paragraph [`spacing`](/docs/reference/model/par/#parameters-spacing) for wide (non-tight) lists.
|
||||
- type: auto | length
|
||||
- default: auto
|
||||
- children:
|
||||
- description: The bullet list\'s children. When using the list syntax, adjacent items are automatically collected into lists, even through constructs like for loops. ```typst #for letter in "ABC" [ - Letter #letter ] ```
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
## Definitions
|
||||
### list.item
|
||||
|
||||
A bullet list item.
|
||||
|
||||
```typst
|
||||
#list.item(
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- body:
|
||||
- description: The item\'s body.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
# Numbering
|
||||
|
||||
# numbering
|
||||
|
||||
Applies a numbering to a sequence of numbers.
|
||||
|
||||
A numbering defines how a sequence of numbers should be displayed as content. It is defined either through a pattern string or an arbitrary function.
|
||||
|
||||
A numbering pattern consists of counting symbols, for which the actual number is substituted, their prefixes, and one suffix. The prefixes and the suffix are displayed as-is.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#numbering("1.1)", 1, 2, 3) \
|
||||
#numbering("1.a.i", 1, 2) \
|
||||
#numbering("I – 1", 12, 2) \
|
||||
#numbering(
|
||||
(..nums) => nums
|
||||
.pos()
|
||||
.map(str)
|
||||
.join(".") + ")",
|
||||
1, 2, 3,
|
||||
)
|
||||
```
|
||||
|
||||
## Numbering patterns and numbering functions
|
||||
|
||||
There are multiple instances where you can provide a numbering pattern or function in Typst. For example, when defining how to number [headings](/docs/reference/model/heading/) or [figures](/docs/reference/model/figure/). Every time, the expected format is the same as the one described below for the [`numbering`](/docs/reference/model/numbering/#parameters-numbering) parameter.
|
||||
|
||||
The following example illustrates that a numbering function is just a regular [function](/docs/reference/foundations/function/) that accepts numbers and returns [`content`](/docs/reference/foundations/content/).
|
||||
|
||||
```typst
|
||||
#let unary(.., last) = "|" * last
|
||||
#set heading(numbering: unary)
|
||||
= First heading
|
||||
= Second heading
|
||||
= Third heading
|
||||
```
|
||||
|
||||
```typst
|
||||
#numbering(
|
||||
numbering,
|
||||
numbers
|
||||
) -> any
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- numbering:
|
||||
- description: Defines how the numbering works. **Counting symbols** are `1`, `a`, `A`, `i`, `I`, `α`, `Α`, `一`, `壹`, `あ`, `い`, `ア`, `イ`, `א`, `가`, `ㄱ`, `*`, `١`, `۱`, `१`, `১`, `ক`, `①`, and `⓵`. They are replaced by the number in the sequence, preserving the original case. The `*` character means that symbols should be used to count, in the order of `*`, `†`, `‡`, `§`, `¶`, `‖`. If there are more than six items, the number is represented using repeated symbols. **Suffixes** are all characters after the last counting symbol. They are displayed as-is at the end of any rendered number. **Prefixes** are all characters that are neither counting symbols nor suffixes. They are displayed as-is at in front of their rendered equivalent of their counting symbol. This parameter can also be an arbitrary function that gets each number as an individual argument. When given a function, the `numbering` function just forwards the arguments to that function. While this is not particularly useful in itself, it means that you can just give arbitrary numberings to the `numbering` function without caring whether they are defined as a pattern or function.
|
||||
- type: str | function
|
||||
- default: None
|
||||
- numbers:
|
||||
- description: The numbers to apply the numbering to. Must be non-negative. In general, numbers are counted from one. A number of zero indicates that the first element has not yet appeared. If `numbering` is a pattern and more numbers than counting symbols are given, the last counting symbol with its prefix is repeated.
|
||||
- type: int
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
# Outline
|
||||
|
||||
# outline
|
||||
|
||||
A table of contents, figures, or other elements.
|
||||
|
||||
This function generates a list of all occurrences of an element in the document, up to a given [`depth`](/docs/reference/model/outline/#parameters-depth). The element's numbering and page number will be displayed in the outline alongside its title or caption.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#set heading(numbering: "1.")
|
||||
#outline()
|
||||
|
||||
= Introduction
|
||||
#lorem(5)
|
||||
|
||||
= Methods
|
||||
== Setup
|
||||
#lorem(10)
|
||||
```
|
||||
|
||||
## Alternative outlines
|
||||
|
||||
In its default configuration, this function generates a table of contents. By setting the `target` parameter, the outline can be used to generate a list of other kinds of elements than headings.
|
||||
|
||||
In the example below, we list all figures containing images by setting `target` to `figure.where(kind: image)`. Just the same, we could have set it to `figure.where(kind: table)` to generate a list of tables.
|
||||
|
||||
We could also set it to just `figure`, without using a [`where`](/docs/reference/foundations/function/#definitions-where) selector, but then the list would contain _all_ figures, be it ones containing images, tables, or other material.
|
||||
|
||||
```typst
|
||||
#outline(
|
||||
title: [List of Figures],
|
||||
target: figure.where(kind: image),
|
||||
)
|
||||
|
||||
#figure(
|
||||
image("tiger.jpg"),
|
||||
caption: [A nice figure!],
|
||||
)
|
||||
```
|
||||
|
||||
## Styling the outline
|
||||
|
||||
At the most basic level, you can style the outline by setting properties on it and its entries. This way, you can customize the outline's [title](/docs/reference/model/outline/#parameters-title), how outline entries are [indented](/docs/reference/model/outline/#parameters-indent), and how the space between an entry's text and its page number should be [filled](/docs/reference/model/outline/#definitions-entry-fill).
|
||||
|
||||
Richer customization is possible through configuration of the outline's [entries](/docs/reference/model/outline/#definitions-entry). The outline generates one entry for each outlined element.
|
||||
|
||||
### Spacing the entries
|
||||
|
||||
Outline entries are [blocks](/docs/reference/layout/block/), so you can adjust the spacing between them with normal block-spacing rules:
|
||||
|
||||
```typst
|
||||
#show outline.entry.where(
|
||||
level: 1
|
||||
): set block(above: 1.2em)
|
||||
|
||||
#outline()
|
||||
|
||||
= About ACME Corp.
|
||||
== History
|
||||
=== Origins
|
||||
= Products
|
||||
== ACME Tools
|
||||
```
|
||||
|
||||
### Building an outline entry from its parts
|
||||
|
||||
For full control, you can also write a transformational show rule on `outline.entry`. However, the logic for properly formatting and indenting outline entries is quite complex and the outline entry itself only contains two fields: The level and the outlined element.
|
||||
|
||||
For this reason, various helper functions are provided. You can mix and match these to compose an entry from just the parts you like.
|
||||
|
||||
The default show rule for an outline entry looks like this[1](#1):
|
||||
|
||||
```typst
|
||||
#show outline.entry: it => link(
|
||||
it.element.location(),
|
||||
it.indented(it.prefix(), it.inner()),
|
||||
)
|
||||
```
|
||||
|
||||
- The [`indented`](/docs/reference/model/outline/#definitions-entry-definitions-indented) function takes an optional prefix and inner content and automatically applies the proper indentation to it, such that different entries align nicely and long headings wrap properly.
|
||||
- The [`prefix`](/docs/reference/model/outline/#definitions-entry-definitions-prefix) function formats the element's numbering (if any). It also appends a supplement for certain elements.
|
||||
- The [`inner`](/docs/reference/model/outline/#definitions-entry-definitions-inner) function combines the element's [`body`](/docs/reference/model/outline/#definitions-entry-definitions-body), the filler, and the [`page` number](/docs/reference/model/outline/#definitions-entry-definitions-page).
|
||||
|
||||
You can use these individual functions to format the outline entry in different ways. Let's say, you'd like to fully remove the filler and page numbers. To achieve this, you could write a show rule like this:
|
||||
|
||||
```typst
|
||||
#show outline.entry: it => link(
|
||||
it.element.location(),
|
||||
// Keep just the body, dropping
|
||||
// the fill and the page.
|
||||
it.indented(it.prefix(), it.body()),
|
||||
)
|
||||
|
||||
#outline()
|
||||
|
||||
= About ACME Corp.
|
||||
== History
|
||||
```
|
||||
|
||||
[^1]: The outline of equations is the exception to this rule as it does not have a body and thus does not use indented layout.
|
||||
|
||||
```typst
|
||||
#outline(
|
||||
title: none | auto | content,
|
||||
target: label | selector | location | function,
|
||||
depth: none | int,
|
||||
indent: auto | relative | function
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- title:
|
||||
- description: The title of the outline. - When set to `auto`, an appropriate title for the [text language](/docs/reference/text/text/#parameters-lang) will be used. - When set to `none`, the outline will not have a title. - A custom title can be set by passing content. The outline\'s heading will not be numbered by default, but you can force it to be with a show-set rule: `show outline: set heading(numbering: "1.")`
|
||||
- type: none | auto | content
|
||||
- default: auto
|
||||
- target:
|
||||
- description: The type of element to include in the outline. To list figures containing a specific kind of element, like an image or a table, you can specify the desired kind in a [`where`](/docs/reference/foundations/function/#definitions-where) selector. See the section on [alternative outlines](/docs/reference/model/outline/#alternative-outlines) for more details. ```typst #outline( title: [List of Tables], target: figure.where(kind: table), ) #figure( table( columns: 4, [t], [1], [2], [3], [y], [0.3], [0.7], [0.5], ), caption: [Experiment results], ) ```
|
||||
- type: label | selector | location | function
|
||||
- default: heading
|
||||
- depth:
|
||||
- description: The maximum level up to which elements are included in the outline. When this argument is `none`, all elements are included. ```typst #set heading(numbering: "1.") #outline(depth: 2) = Yes Top-level section. == Still Subsection. === Nope Not included. ```
|
||||
- type: none | int
|
||||
- default: none
|
||||
- indent:
|
||||
- description: How to indent the outline\'s entries. - `auto`: Indents the numbering/prefix of a nested entry with the title of its parent entry. If the entries are not numbered (e.g., via [heading numbering](/docs/reference/model/heading/#parameters-numbering)), this instead simply inserts a fixed amount of `1.2em` indent per level. - [Relative length](/docs/reference/layout/relative/): Indents the entry by the specified length per nesting level. Specifying `2em`, for instance, would indent top-level headings by `0em` (not nested), second level headings by `2em` (nested once), third-level headings by `4em` (nested twice) and so on. - [Function](/docs/reference/foundations/function/): You can further customize this setting with a function. That function receives the nesting level as a parameter (starting at 0 for top-level headings/elements) and should return a (relative) length. For example, `n => n * 2em` would be equivalent to just specifying `2em`. ```typst #set heading(numbering: "I-I.") #set outline(title: none) #outline() #line(length: 100%) #outline(indent: 3em) = Software engineering technologies == Requirements == Tools and technologies === Code editors == Analyzing alternatives = Designing software components = Testing and integration ```
|
||||
- type: auto | relative | function
|
||||
- default: auto
|
||||
|
||||
|
||||
## Definitions
|
||||
### outline.entry
|
||||
|
||||
Represents an entry line in an outline.
|
||||
|
||||
With show-set and show rules on outline entries, you can richly customize the outline's appearance. See the [section on styling the outline](/docs/reference/model/outline/#styling-the-outline) for details.
|
||||
|
||||
```typst
|
||||
#outline.entry(
|
||||
level,
|
||||
element,
|
||||
fill: none | content
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- level:
|
||||
- description: The nesting level of this outline entry. Starts at `1` for top-level entries.
|
||||
- type: int
|
||||
- default: None
|
||||
- element:
|
||||
- description: The element this entry refers to. Its location will be available through the [`location`](/docs/reference/foundations/content/#definitions-location) method on the content and can be [linked](/docs/reference/model/link/) to.
|
||||
- type: content
|
||||
- default: None
|
||||
- fill:
|
||||
- description: Content to fill the space between the title and the page number. Can be set to `none` to disable filling. The `fill` will be placed into a fractionally sized box that spans the space between the entry\'s body and the page number. When using show rules to override outline entries, it is thus recommended to wrap the fill in a [`box`](/docs/reference/layout/box/) with fractional width, i.e. `box(width: 1fr, it.fill)`. When using [`repeat`](/docs/reference/layout/repeat/), the [`gap`](/docs/reference/layout/repeat/#parameters-gap) property can be useful to tweak the visual weight of the fill. ```typst #set outline.entry(fill: line(length: 100%)) #outline() = A New Beginning ```
|
||||
- type: none | content
|
||||
- default: repeat (body : [.], gap : 0.15em)
|
||||
|
||||
|
||||
#### Definitions
|
||||
##### entry.indented
|
||||
|
||||
A helper function for producing an indented entry layout: Lays out a prefix and the rest of the entry in an indent-aware way.
|
||||
|
||||
If the parent outline's [`indent`](/docs/reference/model/outline/#parameters-indent) is `auto`, the inner content of all entries at level `N` is aligned with the prefix of all entries at level `N + 1`, leaving at least `gap` space between the prefix and inner parts. Furthermore, the `inner` contents of all entries at the same level are aligned.
|
||||
|
||||
If the outline's indent is a fixed value or a function, the prefixes are indented, but the inner contents are simply offset from the prefix by the specified `gap`, rather than aligning outline-wide. For a visual explanation, see [`outline.indent`](/docs/reference/model/outline/#parameters-indent).
|
||||
|
||||
```typst
|
||||
#entry.indented(
|
||||
prefix,
|
||||
inner,
|
||||
gap: length
|
||||
) -> content
|
||||
```
|
||||
|
||||
###### Parameters
|
||||
|
||||
- prefix:
|
||||
- description: The `prefix` is aligned with the `inner` content of entries that have level one less. In the default show rule, this is just `it.prefix()`, but it can be freely customized.
|
||||
- type: none | content
|
||||
- default: None
|
||||
- inner:
|
||||
- description: The formatted inner content of the entry. In the default show rule, this is just `it.inner()`, but it can be freely customized.
|
||||
- type: content
|
||||
- default: None
|
||||
- gap:
|
||||
- description: The gap between the prefix and the inner content.
|
||||
- type: length
|
||||
- default: 0.5em
|
||||
|
||||
##### entry.prefix
|
||||
|
||||
Formats the element's numbering (if any).
|
||||
|
||||
This also appends the element's supplement in case of figures or equations. For instance, it would output `1.1` for a heading, but `Figure 1` for a figure, as is usual for outlines.
|
||||
|
||||
##### entry.inner
|
||||
|
||||
Creates the default inner content of the entry.
|
||||
|
||||
This includes the body, the fill, and page number.
|
||||
|
||||
##### entry.body
|
||||
|
||||
The content which is displayed in place of the referred element at its entry in the outline. For a heading, this is its [`body`](/docs/reference/model/heading/#parameters-body); for a figure a caption and for equations, it is empty.
|
||||
|
||||
##### entry.page
|
||||
|
||||
The page number of this entry's element, formatted with the numbering set for the referenced page.
|
||||
|
||||
|
||||
@@ -0,0 +1,186 @@
|
||||
# Paragraph
|
||||
|
||||
# par
|
||||
|
||||
A logical subdivison of textual content.
|
||||
|
||||
Typst automatically collects _inline-level_ elements into paragraphs. Inline-level elements include [text](/docs/reference/text/text/), [horizontal spacing](/docs/reference/layout/h/), [boxes](/docs/reference/layout/box/), and [inline equations](/docs/reference/math/equation/).
|
||||
|
||||
To separate paragraphs, use a blank line (or an explicit [`parbreak`](/docs/reference/model/parbreak/)). Paragraphs are also automatically interrupted by any block-level element (like [`block`](/docs/reference/layout/block/), [`place`](/docs/reference/layout/place/), or anything that shows itself as one of these).
|
||||
|
||||
The `par` element is primarily used in set rules to affect paragraph properties, but it can also be used to explicitly display its argument as a paragraph of its own. Then, the paragraph's body may not contain any block-level content.
|
||||
|
||||
## Boxes and blocks
|
||||
|
||||
As explained above, usually paragraphs only contain inline-level content. However, you can integrate any kind of block-level content into a paragraph by wrapping it in a [`box`](/docs/reference/layout/box/).
|
||||
|
||||
Conversely, you can separate inline-level content from a paragraph by wrapping it in a [`block`](/docs/reference/layout/block/). In this case, it will not become part of any paragraph at all. Read the following section for an explanation of why that matters and how it differs from just adding paragraph breaks around the content.
|
||||
|
||||
## What becomes a paragraph?
|
||||
|
||||
When you add inline-level content to your document, Typst will automatically wrap it in paragraphs. However, a typical document also contains some text that is not semantically part of a paragraph, for example in a heading or caption.
|
||||
|
||||
The rules for when Typst wraps inline-level content in a paragraph are as follows:
|
||||
|
||||
- All text at the root of a document is wrapped in paragraphs.
|
||||
- Text in a container (like a `block`) is only wrapped in a paragraph if the container holds any block-level content. If all of the contents are inline-level, no paragraph is created.
|
||||
|
||||
In the laid-out document, it's not immediately visible whether text became part of a paragraph. However, it is still important for various reasons:
|
||||
|
||||
- Certain paragraph styling like `first-line-indent` will only apply to proper paragraphs, not any text. Similarly, `par` show rules of course only trigger on paragraphs.
|
||||
- A proper distinction between paragraphs and other text helps people who rely on Assistive Technology (AT) (such as screen readers) navigate and understand the document properly.
|
||||
- PDF export will generate a `P` tag only for paragraphs.
|
||||
- HTML export will generate a `<p>` tag only for paragraphs.
|
||||
|
||||
When creating custom reusable components, you can and should take charge over whether Typst creates paragraphs. By wrapping text in a [`block`](/docs/reference/layout/block/) instead of just adding paragraph breaks around it, you can force the absence of a paragraph. Conversely, by adding a [`parbreak`](/docs/reference/model/parbreak/) after some content in a container, you can force it to become a paragraph even if it's just one word. This is, for example, what [non-`tight`](/docs/reference/model/list/#parameters-tight) lists do to force their items to become paragraphs.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#set par(
|
||||
first-line-indent: 1em,
|
||||
spacing: 0.65em,
|
||||
justify: true,
|
||||
)
|
||||
|
||||
We proceed by contradiction.
|
||||
Suppose that there exists a set
|
||||
of positive integers $a$, $b$, and
|
||||
$c$ that satisfies the equation
|
||||
$a^n + b^n = c^n$ for some
|
||||
integer value of $n > 2$.
|
||||
|
||||
Without loss of generality,
|
||||
let $a$ be the smallest of the
|
||||
three integers. Then, we ...
|
||||
```
|
||||
|
||||
```typst
|
||||
#par(
|
||||
leading: length,
|
||||
spacing: length,
|
||||
justify: bool,
|
||||
justification-limits: dictionary,
|
||||
linebreaks: auto | str,
|
||||
first-line-indent: length | dictionary,
|
||||
hanging-indent: length,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- leading:
|
||||
- description: The spacing between lines. Leading defines the spacing between the [bottom edge](/docs/reference/text/text/#parameters-bottom-edge) of one line and the [top edge](/docs/reference/text/text/#parameters-top-edge) of the following line. By default, these two properties are up to the font, but they can also be configured manually with a text set rule. By setting top edge, bottom edge, and leading, you can also configure a consistent baseline-to-baseline distance. You could, for instance, set the leading to `1em`, the top-edge to `0.8em`, and the bottom-edge to `-0.2em` to get a baseline gap of exactly `2em`. The exact distribution of the top- and bottom-edge values affects the bounds of the first and last line.
|
||||
- type: length
|
||||
- default: 0.65em
|
||||
- spacing:
|
||||
- description: The spacing between paragraphs. Just like leading, this defines the spacing between the bottom edge of a paragraph\'s last line and the top edge of the next paragraph\'s first line. When a paragraph is adjacent to a [`block`](/docs/reference/layout/block/) that is not a paragraph, that block\'s [`above`](/docs/reference/layout/block/#parameters-above) or [`below`](/docs/reference/layout/block/#parameters-below) property takes precedence over the paragraph spacing. Headings, for instance, reduce the spacing below them by default for a better look.
|
||||
- type: length
|
||||
- default: 1.2em
|
||||
- justify:
|
||||
- description: Whether to justify text in its line. Hyphenation will be enabled for justified paragraphs if the [text function\'s `hyphenate` property](/docs/reference/text/text/#parameters-hyphenate) is set to `auto` and the current language is known. Note that the current [alignment](/docs/reference/layout/align/#parameters-alignment) still has an effect on the placement of the last line except if it ends with a [justified line break](/docs/reference/text/linebreak/#parameters-justify). By default, Typst only changes the spacing between words to achieve justification. However, you can also allow it to adjust the spacing between individual characters using the [`justification-limits` property](/docs/reference/model/par/#parameters-justification-limits).
|
||||
- type: bool
|
||||
- default: false
|
||||
- justification-limits:
|
||||
- description: How much the spacing between words and characters may be adjusted during justification. When justifying text, Typst needs to stretch or shrink a line to the full width of the measure. To achieve this, by default, it adjusts the spacing between words. Additionally, it can also adjust the spacing between individual characters. This property allows you to configure lower and upper bounds for these adjustments. The property accepts a dictionary with two entries, `spacing` and `tracking`, each containing a dictionary with the keys `min` and `max`. The `min` keys define down to which lower bound gaps may be shrunk while the `max` keys define up to which upper bound they may be stretched. - The `spacing` entry defines how much the width of spaces between words may be adjusted. It is closely related to [`text.spacing`](/docs/reference/text/text/#parameters-spacing) and its `min` and `max` keys accept [relative lengths](/docs/reference/layout/relative/), just like the `spacing` property. A `min` value of `100%` means that spaces should retain their normal size (i.e. not be shrunk), while a value of `90% - 0.01em` would indicate that a space can be shrunk to a width of 90% of its normal width minus 0.01× the current font size. Similarly, a `max` value of `100% + 0.02em` means that a space\'s width can be increased by 0.02× the current font size. The ratio part must always be positive. The length part, meanwhile, must not be positive for `min` and not be negative for `max`. Note that spaces may still be expanded beyond the `max` value if there is no way to justify the line otherwise. However, other means of justification (e.g. spacing apart characters if the `tracking` entry is configured accordingly) are first used to their maximum. - The `tracking` entry defines how much the spacing between letters may be adjusted. It is closely related to [`text.tracking`](/docs/reference/text/text/#parameters-tracking) and its `min` and `max` keys accept [lengths](/docs/reference/layout/length/), just like the `tracking` property. Unlike `spacing`, it does not accept relative lengths because the base of the relative length would vary for each character, leading to an uneven visual appearance. The behavior compared to `spacing` is as if the base was `100%`. Otherwise, the `min` and `max` values work just like for `spacing`. A `max` value of `0.01em` means that additional spacing amounting to 0.01× of the current font size may be inserted between every pair of characters. Note that this also includes the gaps between spaces and characters, so for spaces the values of `tracking` act in addition to the values for `spacing`. If you only specify one of `spacing` or `tracking`, the other retains its previously set value (or the default if it was not previously set). If you want to enable character-level justification, a good value for the `min` and `max` keys is around `0.01em` to `0.02em` (negated for `min`). Using the same value for both gives a good baseline, but tweaking the two values individually may produce more balanced results, as demonstrated in the example below. Be careful not to set the bounds too wide, as it quickly looks unnatural. Using character-level justification is an impactful microtypographical technique that can improve the appearance of justified text, especially in narrow columns. Note though that character-level justification does not work with every font or language. For example, cursive fonts connect letters. Using character-level justification would lead to jagged connections. ```typst #let example(name) = columns(2, gutter: 10pt)[ #place(top, float: true, scope: "parent", strong(name)) /* Text from https://en.wikipedia.org/wiki/Anne_Bayley */ ] #set page(width: 440pt, height: 21em, margin: 15pt) #set par(justify: true) #set text(size: 0.8em) #grid( columns: (1fr, 1fr), gutter: 20pt, { // These are Typst\'s default limits. set par(justification-limits: ( spacing: (min: 100% * 2 / 3, max: 150%), tracking: (min: 0em, max: 0em), )) example[Word-level justification] }, { // These are our custom character-level limits. set par(justification-limits: ( tracking: (min: -0.01em, max: 0.02em), )) example[Character-level justification] }, ) ```
|
||||
- type: dictionary
|
||||
- default: (spacing : (min : 66.67 % + 0pt, max : 150 % + 0pt), tracking : (min : 0pt, max : 0pt),)
|
||||
- linebreaks:
|
||||
- description: How to determine line breaks. When this property is set to `auto`, its default value, optimized line breaks will be used for justified paragraphs. Enabling optimized line breaks for ragged paragraphs may also be worthwhile to improve the appearance of the text. ```typst #set page(width: 207pt) #set par(linebreaks: "simple") Some texts feature many longer words. Those are often exceedingly challenging to break in a visually pleasing way. #set par(linebreaks: "optimized") Some texts feature many longer words. Those are often exceedingly challenging to break in a visually pleasing way. ```
|
||||
- type: auto | str
|
||||
- default: auto
|
||||
- first-line-indent:
|
||||
- description: The indent the first line of a paragraph should have. By default, only the first line of a consecutive paragraph will be indented (not the first one in the document or container, and not paragraphs immediately following other block-level elements). If you want to indent all paragraphs instead, you can pass a dictionary containing the `amount` of indent as a length and the pair `all: true`. When `all` is omitted from the dictionary, it defaults to `false`. By typographic convention, paragraph breaks are indicated either by some space between paragraphs or by indented first lines. Consider - reducing the [paragraph `spacing`](/docs/reference/model/par/#parameters-spacing) to the [`leading`](/docs/reference/model/par/#parameters-leading) using `set par(spacing: 0.65em)` - increasing the [block `spacing`](/docs/reference/layout/block/#parameters-spacing) (which inherits the paragraph spacing by default) to the original paragraph spacing using `set block(spacing: 1.2em)` ```typst #set block(spacing: 1.2em) #set par( first-line-indent: 1.5em, spacing: 0.65em, ) The first paragraph is not affected by the indent. But the second paragraph is. #line(length: 100%) #set par(first-line-indent: ( amount: 1.5em, all: true, )) Now all paragraphs are affected by the first line indent. Even the first one. ```
|
||||
- type: length | dictionary
|
||||
- default: (amount : 0pt, all : false)
|
||||
- hanging-indent:
|
||||
- description: The indent that all but the first line of a paragraph should have. ```typst #set par(hanging-indent: 1em) #lorem(15) ```
|
||||
- type: length
|
||||
- default: 0pt
|
||||
- body:
|
||||
- description: The contents of the paragraph.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
## Definitions
|
||||
### par.line
|
||||
|
||||
A paragraph line.
|
||||
|
||||
This element is exclusively used for line number configuration through set rules and cannot be placed.
|
||||
|
||||
The [`numbering`](/docs/reference/model/par/#definitions-line-numbering) option is used to enable line numbers by specifying a numbering format.
|
||||
|
||||
```typst
|
||||
#set par.line(numbering: "1")
|
||||
|
||||
Roses are red. \
|
||||
Violets are blue. \
|
||||
Typst is there for you.
|
||||
```
|
||||
|
||||
The `numbering` option takes either a predefined [numbering pattern](/docs/reference/model/numbering/) or a function returning styled content. You can disable line numbers for text inside certain elements by setting the numbering to `none` using show-set rules.
|
||||
|
||||
```typst
|
||||
// Styled red line numbers.
|
||||
#set par.line(
|
||||
numbering: n => text(red)[#n]
|
||||
)
|
||||
|
||||
// Disable numbers inside figures.
|
||||
#show figure: set par.line(
|
||||
numbering: none
|
||||
)
|
||||
|
||||
Roses are red. \
|
||||
Violets are blue.
|
||||
|
||||
#figure(
|
||||
caption: [Without line numbers.]
|
||||
)[
|
||||
Lorem ipsum \
|
||||
dolor sit amet
|
||||
]
|
||||
|
||||
The text above is a sample \
|
||||
originating from distant times.
|
||||
```
|
||||
|
||||
This element exposes further options which may be used to control other aspects of line numbering, such as its [alignment](/docs/reference/model/par/#definitions-line-number-align) or [margin](/docs/reference/model/par/#definitions-line-number-margin). In addition, you can control whether the numbering is reset on each page through the [`numbering-scope`](/docs/reference/model/par/#definitions-line-numbering-scope) option.
|
||||
|
||||
```typst
|
||||
#par.line(
|
||||
numbering: none | str | function,
|
||||
number-align: auto | alignment,
|
||||
number-margin: alignment,
|
||||
number-clearance: auto | length,
|
||||
numbering-scope: str
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- numbering:
|
||||
- description: How to number each line. Accepts a [numbering pattern or function](/docs/reference/model/numbering/) taking a single number. ```typst #set par.line(numbering: "I") Roses are red. \\ Violets are blue. \\ Typst is there for you. ``` ```typst #set par.line( numbering: i => if calc.rem(i, 5) == 0 or i == 1 { i }, ) #lorem(60) ```
|
||||
- type: none | str | function
|
||||
- default: none
|
||||
- number-align:
|
||||
- description: The alignment of line numbers associated with each line. The default of `auto` indicates a smart default where numbers grow horizontally away from the text, considering the margin they\'re in and the current text direction. ```typst #set par.line( numbering: "I", number-align: left, ) Hello world! \\ Today is a beautiful day \\ For exploring the world. ```
|
||||
- type: auto | alignment
|
||||
- default: auto
|
||||
- number-margin:
|
||||
- description: The margin at which line numbers appear. _Note:_ In a multi-column document, the line numbers for paragraphs inside the last column will always appear on the `end` margin (right margin for left-to-right text and left margin for right-to-left), regardless of this configuration. That behavior cannot be changed at this moment. ```typst #set par.line( numbering: "1", number-margin: right, ) = Report - Brightness: Dark, yet darker - Readings: Negative ```
|
||||
- type: alignment
|
||||
- default: start
|
||||
- number-clearance:
|
||||
- description: The distance between line numbers and text. The default value of `auto` results in a clearance that is adaptive to the page width and yields reasonable results in most cases. ```typst #set par.line( numbering: "1", number-clearance: 4pt, ) Typesetting \\ Styling \\ Layout ```
|
||||
- type: auto | length
|
||||
- default: auto
|
||||
- numbering-scope:
|
||||
- description: Controls when to reset line numbering. _Note:_ The line numbering scope must be uniform across each page run (a page run is a sequence of pages without an explicit pagebreak in between). For this reason, set rules for it should be defined before any page content, typically at the very start of the document. ```typst #set par.line( numbering: "1", numbering-scope: "page", ) First line \\ Second line #pagebreak() First line again \\ Second line again ```
|
||||
- type: str
|
||||
- default: "document"
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
# Paragraph Break
|
||||
|
||||
# parbreak
|
||||
|
||||
A paragraph break.
|
||||
|
||||
This starts a new paragraph. Especially useful when used within code like [for loops](/docs/reference/scripting/#loops). Multiple consecutive paragraph breaks collapse into a single one.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#for i in range(3) {
|
||||
[Blind text #i: ]
|
||||
lorem(5)
|
||||
parbreak()
|
||||
}
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
Instead of calling this function, you can insert a blank line into your markup to create a paragraph break.
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# Quote
|
||||
|
||||
# quote
|
||||
|
||||
Displays a quote alongside an optional attribution.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
Plato is often misquoted as the author of #quote[I know that I know
|
||||
nothing], however, this is a derivation form his original quote:
|
||||
|
||||
#set quote(block: true)
|
||||
|
||||
#quote(attribution: [Plato])[
|
||||
... ἔοικα γοῦν τούτου γε σμικρῷ τινι αὐτῷ τούτῳ σοφώτερος εἶναι, ὅτι
|
||||
ἃ μὴ οἶδα οὐδὲ οἴομαι εἰδέναι.
|
||||
]
|
||||
#quote(attribution: [from the Henry Cary literal translation of 1897])[
|
||||
... I seem, then, in just this little thing to be wiser than this man at
|
||||
any rate, that what I do not know I do not think I know either.
|
||||
]
|
||||
```
|
||||
|
||||
By default block quotes are padded left and right by `1em`, alignment and padding can be controlled with show rules:
|
||||
|
||||
```typst
|
||||
#set quote(block: true)
|
||||
#show quote: set align(center)
|
||||
#show quote: set pad(x: 5em)
|
||||
|
||||
#quote[
|
||||
You cannot pass... I am a servant of the Secret Fire, wielder of the
|
||||
flame of Anor. You cannot pass. The dark fire will not avail you,
|
||||
flame of Udûn. Go back to the Shadow! You cannot pass.
|
||||
]
|
||||
```
|
||||
|
||||
```typst
|
||||
#quote(
|
||||
block: bool,
|
||||
quotes: auto | bool,
|
||||
attribution: none | label | content,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- block:
|
||||
- description: Whether this is a block quote. ```typst An inline citation would look like this: #quote( attribution: [René Descartes] )[ cogito, ergo sum ], and a block equation like this: #quote( block: true, attribution: [JFK] )[ Ich bin ein Berliner. ] ```
|
||||
- type: bool
|
||||
- default: false
|
||||
- quotes:
|
||||
- description: Whether double quotes should be added around this quote. The double quotes used are inferred from the `quotes` property on [smartquote](/docs/reference/text/smartquote/), which is affected by the `lang` property on [text](/docs/reference/text/text/). - `true`: Wrap this quote in double quotes. - `false`: Do not wrap this quote in double quotes. - `auto`: Infer whether to wrap this quote in double quotes based on the `block` property. If `block` is `false`, double quotes are automatically added. ```typst #set text(lang: "de") Ein deutsch-sprechender Author zitiert unter umständen JFK: #quote[Ich bin ein Berliner.] #set text(lang: "en") And an english speaking one may translate the quote: #quote[I am a Berliner.] ```
|
||||
- type: auto | bool
|
||||
- default: auto
|
||||
- attribution:
|
||||
- description: The attribution of this quote, usually the author or source. Can be a label pointing to a bibliography entry or any content. By default only displayed for block quotes, but can be changed using a `show` rule. ```typst #quote(attribution: [René Descartes])[ cogito, ergo sum ] #show quote.where(block: false): it => { ["] + h(0pt, weak: true) + it.body + h(0pt, weak: true) + ["] if it.attribution != none [ (#it.attribution)] } #quote( attribution: link("https://typst.app/home")[typst.app] )[ Compose papers faster ] #set quote(block: true) #quote(attribution: <tolkien54>)[ You cannot pass... I am a servant of the Secret Fire, wielder of the flame of Anor. You cannot pass. The dark fire will not avail you, flame of Udûn. Go back to the Shadow! You cannot pass. ] #bibliography("works.bib", style: "apa") ```
|
||||
- type: none | label | content
|
||||
- default: none
|
||||
- body:
|
||||
- description: The quote.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
# Reference
|
||||
|
||||
# ref
|
||||
|
||||
A reference to a label or bibliography.
|
||||
|
||||
Takes a label and cross-references it. There are two kind of references, determined by its [`form`](/docs/reference/model/ref/#parameters-form): `"normal"` and `"page"`.
|
||||
|
||||
The default, a `"normal"` reference, produces a textual reference to a label. For example, a reference to a heading will yield an appropriate string such as "Section 1" for a reference to the first heading. The word "Section" depends on the [`lang`](/docs/reference/text/text/#parameters-lang) setting and is localized accordingly. The references are also links to the respective element. Reference syntax can also be used to [cite](/docs/reference/model/cite/) from a bibliography.
|
||||
|
||||
As the default form requires a supplement and numbering, the label must be attached to a _referenceable element_. Referenceable elements include [headings](/docs/reference/model/heading/), [figures](/docs/reference/model/figure/), [equations](/docs/reference/math/equation/), and [footnotes](/docs/reference/model/footnote/). To create a custom referenceable element like a theorem, you can create a figure of a custom [`kind`](/docs/reference/model/figure/#parameters-kind) and write a show rule for it. In the future, there might be a more direct way to define a custom referenceable element.
|
||||
|
||||
If you just want to link to a labelled element and not get an automatic textual reference, consider using the [`link`](/docs/reference/model/link/) function instead.
|
||||
|
||||
A `"page"` reference produces a page reference to a label, displaying the page number at its location. You can use the [page's supplement](/docs/reference/layout/page/#parameters-supplement) to modify the text before the page number. Unlike a `"normal"` reference, the label can be attached to any element.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#set page(numbering: "1")
|
||||
#set heading(numbering: "1.")
|
||||
#set math.equation(numbering: "(1)")
|
||||
|
||||
= Introduction <intro>
|
||||
Recent developments in
|
||||
typesetting software have
|
||||
rekindled hope in previously
|
||||
frustrated researchers. @distress
|
||||
As shown in @results (see
|
||||
#ref(<results>, form: "page")),
|
||||
we ...
|
||||
|
||||
= Results <results>
|
||||
We discuss our approach in
|
||||
comparison with others.
|
||||
|
||||
== Performance <perf>
|
||||
@slow demonstrates what slow
|
||||
software looks like.
|
||||
$ T(n) = O(2^n) $ <slow>
|
||||
|
||||
#bibliography("works.bib")
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This function also has dedicated syntax: A `"normal"` reference to a label can be created by typing an `@` followed by the name of the label (e.g. `= Introduction <intro>` can be referenced by typing `@intro`).
|
||||
|
||||
To customize the supplement, add content in square brackets after the reference: `@intro[Chapter]`.
|
||||
|
||||
## Customization
|
||||
|
||||
When you only ever need to reference pages of a figure/table/heading/etc. in a document, the default `form` field value can be changed to `"page"` with a set rule. If you prefer a short "p." supplement over "page", the [`page.supplement`](/docs/reference/layout/page/#parameters-supplement) field can be used for changing this:
|
||||
|
||||
```typst
|
||||
#set page(
|
||||
numbering: "1",
|
||||
supplement: "p.",
|
||||
)
|
||||
#set ref(form: "page")
|
||||
|
||||
#figure(
|
||||
stack(
|
||||
dir: ltr,
|
||||
spacing: 1em,
|
||||
circle(),
|
||||
square(),
|
||||
),
|
||||
caption: [Shapes],
|
||||
) <shapes>
|
||||
|
||||
#pagebreak()
|
||||
|
||||
See @shapes for examples
|
||||
of different shapes.
|
||||
```
|
||||
|
||||
If you write a show rule for references, you can access the referenced element through the `element` field of the reference. The `element` may be `none` even if it exists if Typst hasn't discovered it yet, so you always need to handle that case in your code.
|
||||
|
||||
```typst
|
||||
#set heading(numbering: "1.")
|
||||
#set math.equation(numbering: "(1)")
|
||||
|
||||
#show ref: it => {
|
||||
let eq = math.equation
|
||||
let el = it.element
|
||||
// Skip all other references.
|
||||
if el == none or el.func() != eq { return it }
|
||||
// Override equation references.
|
||||
link(el.location(), numbering(
|
||||
el.numbering,
|
||||
..counter(eq).at(el.location())
|
||||
))
|
||||
}
|
||||
|
||||
= Beginnings <beginning>
|
||||
In @beginning we prove @pythagoras.
|
||||
$ a^2 + b^2 = c^2 $ <pythagoras>
|
||||
```
|
||||
|
||||
```typst
|
||||
#ref(
|
||||
target,
|
||||
supplement: none | auto | content | function,
|
||||
form: str
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- target:
|
||||
- description: The target label that should be referenced. Can be a label that is defined in the document or, if the [`form`](/docs/reference/model/ref/#parameters-form) is set to `"normal"`, an entry from the [`bibliography`](/docs/reference/model/bibliography/).
|
||||
- type: label
|
||||
- default: None
|
||||
- supplement:
|
||||
- description: A supplement for the reference. If the [`form`](/docs/reference/model/ref/#parameters-form) is set to `"normal"`: - For references to headings or figures, this is added before the referenced number. - For citations, this can be used to add a page number. If the [`form`](/docs/reference/model/ref/#parameters-form) is set to `"page"`, then this is added before the page number of the label referenced. If a function is specified, it is passed the referenced element and should return content. ```typst #set heading(numbering: "1.") #show ref.where( form: "normal" ): set ref(supplement: it => { if it.func() == heading { "Chapter" } else { "Thing" } }) = Introduction <intro> In @intro, we see how to turn Sections into Chapters. And in @intro[Part], it is done manually. ```
|
||||
- type: none | auto | content | function
|
||||
- default: auto
|
||||
- form:
|
||||
- description: The kind of reference to produce. ```typst #set page(numbering: "1") Here <here> we are on #ref(<here>, form: "page"). ```
|
||||
- type: str
|
||||
- default: "normal"
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
# Strong Emphasis
|
||||
|
||||
# strong
|
||||
|
||||
Strongly emphasizes content by increasing the font weight.
|
||||
|
||||
Increases the current font weight by a given `delta`.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
This is *strong.* \
|
||||
This is #strong[too.] \
|
||||
|
||||
#show strong: set text(red)
|
||||
And this is *evermore.*
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This function also has dedicated syntax: To strongly emphasize content, simply enclose it in stars/asterisks (`*`). Note that this only works at word boundaries. To strongly emphasize part of a word, you have to use the function.
|
||||
|
||||
```typst
|
||||
#strong(
|
||||
delta: int,
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- delta:
|
||||
- description: The delta to apply on the font weight. ```typst #set strong(delta: 0) No *effect!* ```
|
||||
- type: int
|
||||
- default: 300
|
||||
- body:
|
||||
- description: The content to strongly emphasize.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,482 @@
|
||||
# Table
|
||||
|
||||
# table
|
||||
|
||||
A table of items.
|
||||
|
||||
Tables are used to arrange content in cells. Cells can contain arbitrary content, including multiple paragraphs and are specified in row-major order. For a hands-on explanation of all the ways you can use and customize tables in Typst, check out the [Table Guide](/docs/guides/tables/).
|
||||
|
||||
Because tables are just grids with different defaults for some cell properties (notably `stroke` and `inset`), refer to the [grid documentation](/docs/reference/layout/grid/#track-size) for more information on how to size the table tracks and specify the cell appearance properties.
|
||||
|
||||
If you are unsure whether you should be using a table or a grid, consider whether the content you are arranging semantically belongs together as a set of related data points or similar or whether you are just want to enhance your presentation by arranging unrelated content in a grid. In the former case, a table is the right choice, while in the latter case, a grid is more appropriate. Furthermore, Assistive Technology (AT) like screen readers will announce content in a `table` as tabular while a grid's content will be announced no different than multiple content blocks in the document flow. AT users will be able to navigate tables two-dimensionally by cell.
|
||||
|
||||
Note that, to override a particular cell's properties or apply show rules on table cells, you can use the [`table.cell`](/docs/reference/model/table/#definitions-cell) element. See its documentation for more information.
|
||||
|
||||
Although the `table` and the `grid` share most properties, set and show rules on one of them do not affect the other. Locating most of your styling in set and show rules is recommended, as it keeps the table's actual usages clean and easy to read. It also allows you to easily change the appearance of all tables in one place.
|
||||
|
||||
To give a table a caption and make it [referenceable](/docs/reference/model/ref/), put it into a [figure](/docs/reference/model/figure/).
|
||||
|
||||
## Example
|
||||
|
||||
The example below demonstrates some of the most common table options.
|
||||
|
||||
```typst
|
||||
#table(
|
||||
columns: (1fr, auto, auto),
|
||||
inset: 10pt,
|
||||
align: horizon,
|
||||
table.header(
|
||||
[], [*Volume*], [*Parameters*],
|
||||
),
|
||||
image("cylinder.svg"),
|
||||
$ pi h (D^2 - d^2) / 4 $,
|
||||
[
|
||||
$h$: height \
|
||||
$D$: outer radius \
|
||||
$d$: inner radius
|
||||
],
|
||||
image("tetrahedron.svg"),
|
||||
$ sqrt(2) / 12 a^3 $,
|
||||
[$a$: edge length]
|
||||
)
|
||||
```
|
||||
|
||||
Much like with grids, you can use [`table.cell`](/docs/reference/model/table/#definitions-cell) to customize the appearance and the position of each cell.
|
||||
|
||||
```typst
|
||||
#set table(
|
||||
stroke: none,
|
||||
gutter: 0.2em,
|
||||
fill: (x, y) =>
|
||||
if x == 0 or y == 0 { gray },
|
||||
inset: (right: 1.5em),
|
||||
)
|
||||
|
||||
#show table.cell: it => {
|
||||
if it.x == 0 or it.y == 0 {
|
||||
set text(white)
|
||||
strong(it)
|
||||
} else if it.body == [] {
|
||||
// Replace empty cells with 'N/A'
|
||||
pad(..it.inset)[_N/A_]
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
|
||||
#let a = table.cell(
|
||||
fill: green.lighten(60%),
|
||||
)[A]
|
||||
#let b = table.cell(
|
||||
fill: aqua.lighten(60%),
|
||||
)[B]
|
||||
|
||||
#table(
|
||||
columns: 4,
|
||||
[], [Exam 1], [Exam 2], [Exam 3],
|
||||
|
||||
[John], [], a, [],
|
||||
[Mary], [], a, a,
|
||||
[Robert], b, a, b,
|
||||
)
|
||||
```
|
||||
|
||||
## Accessibility
|
||||
|
||||
Tables are challenging to consume for users of Assistive Technology (AT). To make the life of AT users easier, we strongly recommend that you use [`table.header`](/docs/reference/model/table/#definitions-header) and [`table.footer`](/docs/reference/model/table/#definitions-footer) to mark the header and footer sections of your table. This will allow AT to announce the column labels for each cell.
|
||||
|
||||
Because navigating a table by cell is more cumbersome than reading it visually, you should consider making the core information in your table available as text as well. You can do this by wrapping your table in a [figure](/docs/reference/model/figure/) and using its caption to summarize the table's content.
|
||||
|
||||
```typst
|
||||
#table(
|
||||
columns: auto | int | relative | fraction | array,
|
||||
rows: auto | int | relative | fraction | array,
|
||||
gutter: auto | int | relative | fraction | array,
|
||||
column-gutter: auto | int | relative | fraction | array,
|
||||
row-gutter: auto | int | relative | fraction | array,
|
||||
inset: relative | array | dictionary | function,
|
||||
align: auto | array | alignment | function,
|
||||
fill: none | color | gradient | array | tiling | function,
|
||||
stroke: none | length | color | gradient | array | stroke | tiling | dictionary | function,
|
||||
children
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- columns:
|
||||
- description: The column sizes. See the [grid documentation](/docs/reference/layout/grid/#track-size) for more information on track sizing.
|
||||
- type: auto | int | relative | fraction | array
|
||||
- default: ()
|
||||
- rows:
|
||||
- description: The row sizes. See the [grid documentation](/docs/reference/layout/grid/#track-size) for more information on track sizing.
|
||||
- type: auto | int | relative | fraction | array
|
||||
- default: ()
|
||||
- gutter:
|
||||
- description: The gaps between rows and columns. This is a shorthand for setting `column-gutter` and `row-gutter` to the same value. See the [grid documentation](/docs/reference/layout/grid/#parameters-gutter) for more information on gutters.
|
||||
- type: auto | int | relative | fraction | array
|
||||
- default: ()
|
||||
- column-gutter:
|
||||
- description: The gaps between columns. Takes precedence over `gutter`. See the [grid documentation](/docs/reference/layout/grid/#parameters-gutter) for more information on gutters.
|
||||
- type: auto | int | relative | fraction | array
|
||||
- default: ()
|
||||
- row-gutter:
|
||||
- description: The gaps between rows. Takes precedence over `gutter`. See the [grid documentation](/docs/reference/layout/grid/#parameters-gutter) for more information on gutters.
|
||||
- type: auto | int | relative | fraction | array
|
||||
- default: ()
|
||||
- inset:
|
||||
- description: How much to pad the cells\' content. To specify the same inset for all cells, use a single length for all sides, or a dictionary of lengths for individual sides. See the [box\'s documentation](/docs/reference/layout/box/#parameters-inset) for more details. To specify a varying inset for different cells, you can: - use a single, uniform inset for all cells - use an array of insets for each column - use a function that maps a cell\'s X/Y position (both starting from zero) to its inset See the [grid documentation](/docs/reference/layout/grid/#styling) for more details. ```typst #table( columns: 2, inset: 10pt, [Hello], [World], ) #table( columns: 2, inset: (x: 20pt, y: 10pt), [Hello], [World], ) ```
|
||||
- type: relative | array | dictionary | function
|
||||
- default: 0 % + 5pt
|
||||
- align:
|
||||
- description: How to align the cells\' content. If set to `auto`, the outer alignment is used. You can specify the alignment in any of the following fashions: - use a single alignment for all cells - use an array of alignments corresponding to each column - use a function that maps a cell\'s X/Y position (both starting from zero) to its alignment See the [Table Guide](/docs/guides/tables/#alignment) for details. ```typst #table( columns: 3, align: (left, center, right), [Hello], [Hello], [Hello], [A], [B], [C], ) ```
|
||||
- type: auto | array | alignment | function
|
||||
- default: auto
|
||||
- fill:
|
||||
- description: How to fill the cells. This can be: - a single fill for all cells - an array of fill corresponding to each column - a function that maps a cell\'s position to its fill Most notably, arrays and functions are useful for creating striped tables. See the [Table Guide](/docs/guides/tables/#fills) for more details. ```typst #table( fill: (x, _) => if calc.odd(x) { luma(240) } else { white }, align: (x, y) => if y == 0 { center } else if x == 0 { left } else { right }, columns: 4, [], [*Q1*], [*Q2*], [*Q3*], [Revenue:], [1000 €], [2000 €], [3000 €], [Expenses:], [500 €], [1000 €], [1500 €], [Profit:], [500 €], [1000 €], [1500 €], ) ```
|
||||
- type: none | color | gradient | array | tiling | function
|
||||
- default: none
|
||||
- stroke:
|
||||
- description: How to [stroke](/docs/reference/visualize/stroke/) the cells. Strokes can be disabled by setting this to `none`. If it is necessary to place lines which can cross spacing between cells produced by the [`gutter`](/docs/reference/model/table/#parameters-gutter) option, or to override the stroke between multiple specific cells, consider specifying one or more of [`table.hline`](/docs/reference/model/table/#definitions-hline) and [`table.vline`](/docs/reference/model/table/#definitions-vline) alongside your table cells. To specify the same stroke for all cells, use a single [stroke](/docs/reference/visualize/stroke/) for all sides, or a dictionary of [strokes](/docs/reference/visualize/stroke/) for individual sides. See the [rectangle\'s documentation](/docs/reference/visualize/rect/#parameters-stroke) for more details. To specify varying strokes for different cells, you can: - use a single stroke for all cells - use an array of strokes corresponding to each column - use a function that maps a cell\'s position to its stroke See the [Table Guide](/docs/guides/tables/#strokes) for more details.
|
||||
- type: none | length | color | gradient | array | stroke | tiling | dictionary | function
|
||||
- default: 1pt + black
|
||||
- children:
|
||||
- description: The contents of the table cells, plus any extra table lines specified with the [`table.hline`](/docs/reference/model/table/#definitions-hline) and [`table.vline`](/docs/reference/model/table/#definitions-vline) elements.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
## Definitions
|
||||
### table.cell
|
||||
|
||||
A cell in the table. Use this to position a cell manually or to apply styling. To do the latter, you can either use the function to override the properties for a particular cell, or use it in show rules to apply certain styles to multiple cells at once.
|
||||
|
||||
Perhaps the most important use case of `table.cell` is to make a cell span multiple columns and/or rows with the `colspan` and `rowspan` fields.
|
||||
|
||||
```typst
|
||||
#show table.cell.where(y: 0): strong
|
||||
#set table(
|
||||
stroke: (x, y) => if y == 0 {
|
||||
(bottom: 0.7pt + black)
|
||||
},
|
||||
align: (x, y) => (
|
||||
if x > 0 { center }
|
||||
else { left }
|
||||
)
|
||||
)
|
||||
|
||||
#table(
|
||||
columns: 3,
|
||||
table.header(
|
||||
[Substance],
|
||||
[Subcritical °C],
|
||||
[Supercritical °C],
|
||||
),
|
||||
[Hydrochloric Acid],
|
||||
[12.0], [92.1],
|
||||
[Sodium Myreth Sulfate],
|
||||
[16.6], [104],
|
||||
[Potassium Hydroxide],
|
||||
table.cell(colspan: 2)[24.7],
|
||||
)
|
||||
```
|
||||
|
||||
For example, you can override the fill, alignment or inset for a single cell:
|
||||
|
||||
```typst
|
||||
// You can also import those.
|
||||
#import table: cell, header
|
||||
|
||||
#table(
|
||||
columns: 2,
|
||||
align: center,
|
||||
header(
|
||||
[*Trip progress*],
|
||||
[*Itinerary*],
|
||||
),
|
||||
cell(
|
||||
align: right,
|
||||
fill: fuchsia.lighten(80%),
|
||||
[🚗],
|
||||
),
|
||||
[Get in, folks!],
|
||||
[🚗], [Eat curbside hotdog],
|
||||
cell(align: left)[🌴🚗],
|
||||
cell(
|
||||
inset: 0.06em,
|
||||
text(1.62em)[🏝️🌅🌊],
|
||||
),
|
||||
)
|
||||
```
|
||||
|
||||
You may also apply a show rule on `table.cell` to style all cells at once. Combined with selectors, this allows you to apply styles based on a cell's position:
|
||||
|
||||
```typst
|
||||
#show table.cell.where(x: 0): strong
|
||||
|
||||
#table(
|
||||
columns: 3,
|
||||
gutter: 3pt,
|
||||
[Name], [Age], [Strength],
|
||||
[Hannes], [36], [Grace],
|
||||
[Irma], [50], [Resourcefulness],
|
||||
[Vikram], [49], [Perseverance],
|
||||
)
|
||||
```
|
||||
|
||||
```typst
|
||||
#table.cell(
|
||||
body,
|
||||
x: auto | int,
|
||||
y: auto | int,
|
||||
colspan: int,
|
||||
rowspan: int,
|
||||
inset: auto | relative | dictionary,
|
||||
align: auto | alignment,
|
||||
fill: none | auto | color | gradient | tiling,
|
||||
stroke: none | length | color | gradient | stroke | tiling | dictionary,
|
||||
breakable: auto | bool
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- body:
|
||||
- description: The cell\'s body.
|
||||
- type: content
|
||||
- default: None
|
||||
- x:
|
||||
- description: The cell\'s column (zero-indexed). Functions identically to the `x` field in [`grid.cell`](/docs/reference/layout/grid/#definitions-cell).
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- y:
|
||||
- description: The cell\'s row (zero-indexed). Functions identically to the `y` field in [`grid.cell`](/docs/reference/layout/grid/#definitions-cell).
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- colspan:
|
||||
- description: The amount of columns spanned by this cell.
|
||||
- type: int
|
||||
- default: 1
|
||||
- rowspan:
|
||||
- description: The amount of rows spanned by this cell.
|
||||
- type: int
|
||||
- default: 1
|
||||
- inset:
|
||||
- description: The cell\'s [inset](/docs/reference/model/table/#parameters-inset) override.
|
||||
- type: auto | relative | dictionary
|
||||
- default: auto
|
||||
- align:
|
||||
- description: The cell\'s [alignment](/docs/reference/model/table/#parameters-align) override.
|
||||
- type: auto | alignment
|
||||
- default: auto
|
||||
- fill:
|
||||
- description: The cell\'s [fill](/docs/reference/model/table/#parameters-fill) override.
|
||||
- type: none | auto | color | gradient | tiling
|
||||
- default: auto
|
||||
- stroke:
|
||||
- description: The cell\'s [stroke](/docs/reference/model/table/#parameters-stroke) override.
|
||||
- type: none | length | color | gradient | stroke | tiling | dictionary
|
||||
- default: (:)
|
||||
- breakable:
|
||||
- description: Whether rows spanned by this cell can be placed in different pages. When equal to `auto`, a cell spanning only fixed-size rows is unbreakable, while a cell spanning at least one `auto`-sized row is breakable.
|
||||
- type: auto | bool
|
||||
- default: auto
|
||||
|
||||
### table.hline
|
||||
|
||||
A horizontal line in the table.
|
||||
|
||||
Overrides any per-cell stroke, including stroke specified through the table's `stroke` field. Can cross spacing between cells created through the table's [`column-gutter`](/docs/reference/model/table/#parameters-column-gutter) option.
|
||||
|
||||
Use this function instead of the table's `stroke` field if you want to manually place a horizontal line at a specific position in a single table. Consider using [table's `stroke`](/docs/reference/model/table/#parameters-stroke) field or [`table.cell`'s `stroke`](/docs/reference/model/table/#definitions-cell-stroke) field instead if the line you want to place is part of all your tables' designs.
|
||||
|
||||
```typst
|
||||
#set table.hline(stroke: .6pt)
|
||||
|
||||
#table(
|
||||
stroke: none,
|
||||
columns: (auto, 1fr),
|
||||
[09:00], [Badge pick up],
|
||||
[09:45], [Opening Keynote],
|
||||
[10:30], [Talk: Typst's Future],
|
||||
[11:15], [Session: Good PRs],
|
||||
table.hline(start: 1),
|
||||
[Noon], [_Lunch break_],
|
||||
table.hline(start: 1),
|
||||
[14:00], [Talk: Tracked Layout],
|
||||
[15:00], [Talk: Automations],
|
||||
[16:00], [Workshop: Tables],
|
||||
table.hline(),
|
||||
[19:00], [Day 1 Attendee Mixer],
|
||||
)
|
||||
```
|
||||
|
||||
```typst
|
||||
#table.hline(
|
||||
y: auto | int,
|
||||
start: int,
|
||||
end: none | int,
|
||||
stroke: none | length | color | gradient | stroke | tiling | dictionary,
|
||||
position: alignment
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- y:
|
||||
- description: The row above which the horizontal line is placed (zero-indexed). Functions identically to the `y` field in [`grid.hline`](/docs/reference/layout/grid/#definitions-hline-y).
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- start:
|
||||
- description: The column at which the horizontal line starts (zero-indexed, inclusive).
|
||||
- type: int
|
||||
- default: 0
|
||||
- end:
|
||||
- description: The column before which the horizontal line ends (zero-indexed, exclusive).
|
||||
- type: none | int
|
||||
- default: none
|
||||
- stroke:
|
||||
- description: The line\'s stroke. Specifying `none` removes any lines previously placed across this line\'s range, including hlines or per-cell stroke below it.
|
||||
- type: none | length | color | gradient | stroke | tiling | dictionary
|
||||
- default: 1pt + black
|
||||
- position:
|
||||
- description: The position at which the line is placed, given its row (`y`) - either `top` to draw above it or `bottom` to draw below it. This setting is only relevant when row gutter is enabled (and shouldn\'t be used otherwise - prefer just increasing the `y` field by one instead), since then the position below a row becomes different from the position above the next row due to the spacing between both.
|
||||
- type: alignment
|
||||
- default: top
|
||||
|
||||
### table.vline
|
||||
|
||||
A vertical line in the table. See the docs for [`grid.vline`](/docs/reference/layout/grid/#definitions-vline) for more information regarding how to use this element's fields.
|
||||
|
||||
Overrides any per-cell stroke, including stroke specified through the table's `stroke` field. Can cross spacing between cells created through the table's [`row-gutter`](/docs/reference/model/table/#parameters-row-gutter) option.
|
||||
|
||||
Similar to [`table.hline`](/docs/reference/model/table/#definitions-hline), use this function if you want to manually place a vertical line at a specific position in a single table and use the [table's `stroke`](/docs/reference/model/table/#parameters-stroke) field or [`table.cell`'s `stroke`](/docs/reference/model/table/#definitions-cell-stroke) field instead if the line you want to place is part of all your tables' designs.
|
||||
|
||||
```typst
|
||||
#table.vline(
|
||||
x: auto | int,
|
||||
start: int,
|
||||
end: none | int,
|
||||
stroke: none | length | color | gradient | stroke | tiling | dictionary,
|
||||
position: alignment
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- x:
|
||||
- description: The column before which the vertical line is placed (zero-indexed). Functions identically to the `x` field in [`grid.vline`](/docs/reference/layout/grid/#definitions-vline).
|
||||
- type: auto | int
|
||||
- default: auto
|
||||
- start:
|
||||
- description: The row at which the vertical line starts (zero-indexed, inclusive).
|
||||
- type: int
|
||||
- default: 0
|
||||
- end:
|
||||
- description: The row on top of which the vertical line ends (zero-indexed, exclusive).
|
||||
- type: none | int
|
||||
- default: none
|
||||
- stroke:
|
||||
- description: The line\'s stroke. Specifying `none` removes any lines previously placed across this line\'s range, including vlines or per-cell stroke below it.
|
||||
- type: none | length | color | gradient | stroke | tiling | dictionary
|
||||
- default: 1pt + black
|
||||
- position:
|
||||
- description: The position at which the line is placed, given its column (`x`) - either `start` to draw before it or `end` to draw after it. The values `left` and `right` are also accepted, but discouraged as they cause your table to be inconsistent between left-to-right and right-to-left documents. This setting is only relevant when column gutter is enabled (and shouldn\'t be used otherwise - prefer just increasing the `x` field by one instead), since then the position after a column becomes different from the position before the next column due to the spacing between both.
|
||||
- type: alignment
|
||||
- default: start
|
||||
|
||||
### table.header
|
||||
|
||||
A repeatable table header.
|
||||
|
||||
You should wrap your tables' heading rows in this function even if you do not plan to wrap your table across pages because Typst uses this function to attach accessibility metadata to tables and ensure [Universal Access](/docs/guides/accessibility/#basics) to your document.
|
||||
|
||||
You can use the `repeat` parameter to control whether your table's header will be repeated across pages.
|
||||
|
||||
Currently, this function is unsuitable for creating a header column or single header cells. Either use regular cells, or, if you are exporting a PDF, you can also use the [`pdf.header-cell`](/docs/reference/pdf/header-cell/) function to mark a cell as a header cell. Likewise, you can use [`pdf.data-cell`](/docs/reference/pdf/data-cell/) to mark cells in this function as data cells. Note that these functions are not final and thus only available when you enable the `a11y-extras` feature (see the [PDF module documentation](/docs/reference/pdf/) for details).
|
||||
|
||||
```typst
|
||||
#set page(height: 11.5em)
|
||||
#set table(
|
||||
fill: (x, y) =>
|
||||
if x == 0 or y == 0 {
|
||||
gray.lighten(40%)
|
||||
},
|
||||
align: right,
|
||||
)
|
||||
|
||||
#show table.cell.where(x: 0): strong
|
||||
#show table.cell.where(y: 0): strong
|
||||
|
||||
#table(
|
||||
columns: 4,
|
||||
table.header(
|
||||
[], [Blue chip],
|
||||
[Fresh IPO], [Penny st'k],
|
||||
),
|
||||
table.cell(
|
||||
rowspan: 6,
|
||||
align: horizon,
|
||||
rotate(-90deg, reflow: true)[
|
||||
*USD / day*
|
||||
],
|
||||
),
|
||||
[0.20], [104], [5],
|
||||
[3.17], [108], [4],
|
||||
[1.59], [84], [1],
|
||||
[0.26], [98], [15],
|
||||
[0.01], [195], [4],
|
||||
[7.34], [57], [2],
|
||||
)
|
||||
```
|
||||
|
||||
```typst
|
||||
#table.header(
|
||||
repeat: bool,
|
||||
level: int,
|
||||
children
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- repeat:
|
||||
- description: Whether this header should be repeated across pages.
|
||||
- type: bool
|
||||
- default: true
|
||||
- level:
|
||||
- description: The level of the header. Must not be zero. This allows repeating multiple headers at once. Headers with different levels can repeat together, as long as they have ascending levels. Notably, when a header with a lower level starts repeating, all higher or equal level headers stop repeating (they are "replaced" by the new header).
|
||||
- type: int
|
||||
- default: 1
|
||||
- children:
|
||||
- description: The cells and lines within the header.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
### table.footer
|
||||
|
||||
A repeatable table footer.
|
||||
|
||||
Just like the [`table.header`](/docs/reference/model/table/#definitions-header) element, the footer can repeat itself on every page of the table. This is useful for improving legibility by adding the column labels in both the header and footer of a large table, totals, or other information that should be visible on every page.
|
||||
|
||||
No other table cells may be placed after the footer.
|
||||
|
||||
```typst
|
||||
#table.footer(
|
||||
repeat: bool,
|
||||
children
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- repeat:
|
||||
- description: Whether this footer should be repeated across pages.
|
||||
- type: bool
|
||||
- default: true
|
||||
- children:
|
||||
- description: The cells and lines within the footer.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# Term List
|
||||
|
||||
# terms
|
||||
|
||||
A list of terms and their descriptions.
|
||||
|
||||
Displays a sequence of terms and their descriptions vertically. When the descriptions span over multiple lines, they use hanging indent to communicate the visual hierarchy.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
/ Ligature: A merged glyph.
|
||||
/ Kerning: A spacing adjustment
|
||||
between two adjacent letters.
|
||||
```
|
||||
|
||||
## Syntax
|
||||
|
||||
This function also has dedicated syntax: Starting a line with a slash, followed by a term, a colon and a description creates a term list item.
|
||||
|
||||
```typst
|
||||
#terms(
|
||||
tight: bool,
|
||||
separator: content,
|
||||
indent: length,
|
||||
hanging-indent: length,
|
||||
spacing: auto | length,
|
||||
children
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- tight:
|
||||
- description: Defines the default [spacing](/docs/reference/model/terms/#parameters-spacing) of the term list. If it is `false`, the items are spaced apart with [paragraph spacing](/docs/reference/model/par/#parameters-spacing). If it is `true`, they use [paragraph leading](/docs/reference/model/par/#parameters-leading) instead. This makes the list more compact, which can look better if the items are short. In markup mode, the value of this parameter is determined based on whether items are separated with a blank line. If items directly follow each other, this is set to `true`; if items are separated by a blank line, this is set to `false`. The markup-defined tightness cannot be overridden with set rules. ```typst / Fact: If a term list has a lot of text, and maybe other inline content, it should not be tight anymore. / Tip: To make it wide, simply insert a blank line between the items. ```
|
||||
- type: bool
|
||||
- default: true
|
||||
- separator:
|
||||
- description: The separator between the item and the description. If you want to just separate them with a certain amount of space, use `h(2cm, weak: true)` as the separator and replace `2cm` with your desired amount of space. ```typst #set terms(separator: [: ]) / Colon: A nice separator symbol. ```
|
||||
- type: content
|
||||
- default: h (amount : 0.6em, weak : true)
|
||||
- indent:
|
||||
- description: The indentation of each item.
|
||||
- type: length
|
||||
- default: 0pt
|
||||
- hanging-indent:
|
||||
- description: The hanging indent of the description. This is in addition to the whole item\'s `indent`. ```typst #set terms(hanging-indent: 0pt) / Term: This term list does not make use of hanging indents. ```
|
||||
- type: length
|
||||
- default: 2em
|
||||
- spacing:
|
||||
- description: The spacing between the items of the term list. If set to `auto`, uses paragraph [`leading`](/docs/reference/model/par/#parameters-leading) for tight term lists and paragraph [`spacing`](/docs/reference/model/par/#parameters-spacing) for wide (non-tight) term lists.
|
||||
- type: auto | length
|
||||
- default: auto
|
||||
- children:
|
||||
- description: The term list\'s children. When using the term list syntax, adjacent items are automatically collected into term lists, even through constructs like for loops. ```typst #for (year, product) in ( "1978": "TeX", "1984": "LaTeX", "2019": "Typst", ) [/ #product: Born in #year.] ```
|
||||
- type: content | array
|
||||
- default: None
|
||||
|
||||
|
||||
## Definitions
|
||||
### terms.item
|
||||
|
||||
A term list item.
|
||||
|
||||
```typst
|
||||
#terms.item(
|
||||
term,
|
||||
description
|
||||
) -> content
|
||||
```
|
||||
|
||||
#### Parameters
|
||||
|
||||
- term:
|
||||
- description: The term described by the list item.
|
||||
- type: content
|
||||
- default: None
|
||||
- description:
|
||||
- description: The description of the term.
|
||||
- type: content
|
||||
- default: None
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# Title
|
||||
|
||||
# title
|
||||
|
||||
A document title.
|
||||
|
||||
This should be used to display the main title of the whole document and should occur only once per document. In contrast, level 1 [headings](/docs/reference/model/heading/) are intended to be used for the top-level sections of the document.
|
||||
|
||||
Note that additional frontmatter (like an author list) that should appear together with the title does not belong in its body.
|
||||
|
||||
In HTML export, this shows as a `h1` element while level 1 headings show as `h2` elements.
|
||||
|
||||
## Example
|
||||
|
||||
```typst
|
||||
#set document(
|
||||
title: [Interstellar Mail Delivery]
|
||||
)
|
||||
|
||||
#title()
|
||||
|
||||
= Introduction
|
||||
In recent years, ...
|
||||
```
|
||||
|
||||
```typst
|
||||
#title(
|
||||
body
|
||||
) -> content
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- body:
|
||||
- description: The content of the title. When omitted (or `auto`), this will default to [`document.title`](/docs/reference/model/document/#parameters-title). In this case, a document title must have been previously set with `set document(title: [..])`. ```typst #set document(title: "Course ABC, Homework 1") #title[Homework 1] ... ```
|
||||
- type: auto | content
|
||||
- default: auto
|
||||
|
||||
|
||||
Reference in new issue
Block a user