link
ShowableShowable functions can be customized with show
rules.
show
rules.Link to a URL or another location in the document.
The link function makes its positional body
argument clickable and links
it to the destination specified by the dest
argument. By default, links
are not styled any different from normal text. However, you can easily apply
a style of your choice with a show rule.
Example
#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.
ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
dest
The destination the link points to.
-
To link to web pages,
dest
should be a valid URL string. If the URL is in themailto:
ortel:
scheme and thebody
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
must contain a dictionary with apage
key of typeinteger
andx
andy
coordinates of typelength
. Pages are counted from one, and the coordinates are relative to the page's top left corner.
#link("mailto:hello@typst.app") \
#link((page: 1, x: 0pt, y: 0pt))[
Go to top
]

body
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.