underline
ElementElementElement functions can be customized with set
and show
rules.
Element
Element functions can be customized with
set
and show
rules.Underlines text.
Example
This is #underline[important].

ParameterParameterParameters are input values for functions. Specify them in parentheses after the function name.
Parameter
Parameters are input values for functions. Specify them in parentheses after the function name.
stroke
How to stroke the line.
If set to auto
, takes on the text's color and a thickness defined in
the current font.
Default value: auto
Show example
Take #underline(
stroke: 1.5pt + red,
offset: 2pt,
[care],
)

offset
The position of the line relative to the baseline, read from the font
tables if auto
.
Default value: auto
Show example
#underline(offset: 5pt)[
The Tale Of A Faraway Line I
]

extent
SettableSettableSettable parameters can be set using the set
rule, changing the default value used thereafter.
Settable
Settable
Settable parameters can be set using the
set
rule, changing the default value used thereafter.The amount by which to extend the line beyond (or within if negative) the content.
Default value: 0pt
Show example
#align(center,
underline(extent: 2pt)[Chapter 1]
)

evade
SettableSettableSettable parameters can be set using the set
rule, changing the default value used thereafter.
Settable
Settable
Settable parameters can be set using the
set
rule, changing the default value used thereafter.Whether the line skips sections in which it would collide with the glyphs.
Default value: true
Show example
This #underline(evade: true)[is great].
This #underline(evade: false)[is less great].

background
SettableSettableSettable parameters can be set using the set
rule, changing the default value used thereafter.
Settable
Settable
Settable parameters can be set using the
set
rule, changing the default value used thereafter.Whether the line is placed behind the content it underlines.
Default value: false
Show example
#set underline(stroke: (thickness: 1em, paint: maroon, cap: "round"))
#underline(background: true)[This is stylized.] \
#underline(background: false)[This is partially hidden.]

body
RequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.
The content to underline.