注意 当サイトは、Typst v0.11.1 公式ドキュメントを、日本語コミュニティが非公式に翻訳したものです。誤訳・未訳・古い情報が含まれている可能性があるため、公式ドキュメント との併用を推奨します。このサイトの内容に誤りを発見された方は、GitHubリポジトリまでご報告を頂けましたら幸いです。我々のコミュニティにご興味のある方は、ぜひ非公式Discordサーバー「くみはんクラブ」にご参加ください。
Warning: This site provides an unofficial translation of the Typst v0.11.1 documentation by the Japanese Community. Please note that there may be some inaccuracies, untranslated sections or outdated information. We highly recommend referring to the latest official documentation as well. If you find any errors in the content, please let us know through our GitHub repository. If you are interested in our community, feel free to join our unofficial Discord server, “Kumihan Club.”
Typst ドキュメント日本語版

version

A version with an arbitrary number of components.

The first three components have names that can be used as fields: major, minor, patch. All following components do not have names.

The list of components is semantically extended by an infinite list of zeros. This means that, for example, 0.8 is the same as 0.8.0. As a special case, the empty version (that has no components at all) is the same as 0, 0.0, 0.0.0, and so on.

You can convert a version to an array of explicitly given components using the array constructor.

Constructor
If a type has a constructor, you can call it like a function to create a new value of the type.

Creates a new version.

It can have any number of components (even zero).

version() -> version
#version() \
#version(1) \
#version(1, 2, 3, 4) \
#version((1, 2, 3, 4)) \
#version((1, 2), 3)
Preview

components
int array
RequiredPositional
Positional parameters are specified in order, without names.
Variadic
Variadic parameters can be specified multiple times.

The components of the version (array arguments are flattened)

Definitions
Functions and types and can have associated definitions. These are accessed by specifying the function or type, followed by a period, and then the definition's name.

at

Retrieves a component of a version.

The returned integer is always non-negative. Returns 0 if the version isn't specified to the necessary length.

self.at() -> int

index
int
RequiredPositional
Positional parameters are specified in order, without names.

The index at which to retrieve the component. If negative, indexes from the back of the explicitly given components.