linkElementElementElement functions can be customized with set and show rules.
set and show rules.Links to a URL or a location in the document.
By default, links do not look 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
]

Hyphenation
If you enable hyphenation or justification, by default, it will not apply to
links to prevent unwanted hyphenation in URLs. You can opt out of this
default via show link: set text(hyphenate: true).
Syntax
This function also has dedicated syntax: Text that starts with http:// or
https:// is automatically turned into a link.
ParameterParameterParameters are input values for functions. Specify them in parentheses after the function name.
destRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
The destination the link points to.
-
To link to web pages,
destshould be a valid URL string. If the URL is in themailto:ortel:scheme and thebodyparameter 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,
destcan take one of three forms:-
A label attached to an element. If you also want automatic text for the link based on the element, consider using a reference instead.
-
A
location(typically retrieved fromhere,locateorquery). -
A dictionary with a
pagekey of type integer andxandycoordinates of type length. Pages are counted from one, and the coordinates are relative to the page's top left corner.
-
Show example
= Introduction <intro>
#link("mailto:hello@typst.app") \
#link(<intro>)[Go to intro] \
#link((page: 1, x: 0pt, y: 0pt))[
Go to top
]

bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
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.