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

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

Underlines text.

Example

This is #underline[important].
Preview

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

stroke
auto length color gradient stroke pattern dictionary
Settable
Settable parameters can be customized for all following uses of the function with a set rule.

How to stroke the line.

If set to auto, takes on the text's color and a thickness defined in the current font.

Default:auto

View example
Take #underline(
  stroke: 1.5pt + red,
  offset: 2pt,
  [care],
)
Preview

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

The position of the line relative to the baseline, read from the font tables if auto.

Default:auto

View example
#underline(offset: 5pt)[
  The Tale Of A Faraway Line I
]
Preview

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

The amount by which to extend the line beyond (or within if negative) the content.

Default:0pt

View example
#align(center,
  underline(extent: 2pt)[Chapter 1]
)
Preview

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

Whether the line skips sections in which it would collide with the glyphs.

Default:true

View example
This #underline(evade: true)[is great].
This #underline(evade: false)[is less great].
Preview

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

Whether the line is placed behind the content it underlines.

Default:false

View example
#set underline(stroke: (thickness: 1em, paint: maroon, cap: "round"))
#underline(background: true)[This is stylized.] \
#underline(background: false)[This is partially hidden.]
Preview

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

The content to underline.