注意 当サイトは、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 ドキュメント日本語版

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

Arranges text, spacing and inline-level elements into a paragraph.

Although this function is primarily used in set rules to affect paragraph properties, it can also be used to explicitly render its argument onto a paragraph of its own.

Example

#show par: set block(spacing: 0.65em)
#set par(
  first-line-indent: 1em,
  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 ...
Preview

Parameters
Parameters are the inputs to a function. They are specified in parentheses after the function name.

leading
length
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The spacing between lines.

Default:0.65em

justify
bool
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

Whether to justify text in its line.

Hyphenation will be enabled for justified paragraphs if the text function's hyphenate property is set to auto and the current language is known.

Note that the current alignment still has an effect on the placement of the last line except if it ends with a justified line break.

Default:false

linebreaks
auto str
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

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.

Default:auto

View example
#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.
Preview

first-line-indent
length
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The indent the first line of a paragraph should have.

Only the first line of a consecutive paragraph will be indented (not the first one in a block or on the page).

By typographic convention, paragraph breaks are indicated either by some space between paragraphs or by indented first lines. Consider reducing the paragraph spacing to the leading when using this property (e.g. using #show par: set block(spacing: 0.65em)).

Default:0pt

hanging-indent
length
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

The indent all but the first line of a paragraph should have.

Default:0pt

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

The contents of the paragraph.