page
ShowableShowable functions can be customized with show
rules.
show
rules.Layouts its child onto one or multiple pages.
Although this function is primarily used in set rules to affect page properties, it can also be used to explicitly render its argument onto a set of pages of its own.
Pages can be set to use auto
as their width or height. In this case,
the pages will grow to fit their content on the respective axis.
Example
#set page("us-letter")
There you go, US friends!

ParametersParameters are the inputs to a function. They are specified in parentheses after the function name.
body
The contents of the page(s).
Multiple pages will be created if the content does not fit on a single page. A new page with the page properties prior to the function invocation will be created after the body has been typeset.
paper
stringPositionalPositional parameters are specified in order, without names.SettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.A standard paper size to set width and height. When this is not specified,
Typst defaults to "a4"
paper.
- "a0""a1""a2""a3""a4""a5""a6""a7""a8""a9""a10""a11""iso-b1""iso-b2""iso-b3""iso-b4""iso-b5""iso-b6""iso-b7""iso-b8""iso-c3""iso-c4""iso-c5""iso-c6""iso-c7""iso-c8""din-d3""din-d4""din-d5""din-d6""din-d7""din-d8""sis-g5""sis-e5""ansi-a""ansi-b""ansi-c""ansi-d""ansi-e""arch-a""arch-b""arch-c""arch-d""arch-e1""arch-e""jis-b0""jis-b1""jis-b2""jis-b3""jis-b4""jis-b5""jis-b6""jis-b7""jis-b8""jis-b9""jis-b10""jis-b11""sac-d0""sac-d1""sac-d2""sac-d3""sac-d4""sac-d5""sac-d6""iso-id-1""iso-id-2""iso-id-3""asia-f4""jp-shiroku-ban-4""jp-shiroku-ban-5""jp-shiroku-ban-6""jp-kiku-4""jp-kiku-5""jp-business-card""cn-business-card""eu-business-card""fr-tellière""fr-couronne-écriture""fr-couronne-édition""fr-raisin""fr-carré""fr-jésus""uk-brief""uk-draft""uk-foolscap""uk-quarto""uk-crown""uk-book-a""uk-book-b""us-letter""us-legal""us-tabloid""us-executive""us-foolscap-folio""us-statement""us-ledger""us-oficio""us-gov-letter""us-gov-legal""us-business-card""us-digest""us-trade""newspaper-compact""newspaper-berliner""newspaper-broadsheet""presentation-16-9""presentation-4-3"
Produces a paper of the respective size.
width
The width of the page.
#set page(
width: 3cm,
margin: (x: 0cm),
)
#for i in range(3) {
box(square(width: 1cm))
}

height
The height of the page.
If this is set to auto
, page breaks can only be triggered manually
by inserting a page break. Most examples throughout
this documentation use auto
for the height of the page to
dynamically grow and shrink to fit their content.
flipped
booleanSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.Whether the page is flipped into landscape orientation.
#set page(
"us-business-card",
flipped: true,
fill: rgb("f2e5dd"),
)
#set align(bottom + end)
#text(14pt)[*Sam H. Richards*] \
_Procurement Manager_
#set text(10pt)
17 Main Street \
New York, NY 10001 \
+1 555 555 5555

margin
autorelative lengthdictionarySettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.The page's margins.
- A single length: The same margin on all sides.
auto
: The margin is set to the default value for the page's size.- A dictionary: With a dictionary, the margins can be set individually.
The dictionary can contain the following keys in order of precedence:
top
: The top margin.right
: The right margin.bottom
: The bottom margin.left
: The left margin.x
: The horizontal margins.y
: The vertical margins.rest
: The margins on all sides except those for which the dictionary explicitly sets a size.
#set page(
width: 3cm,
height: 4cm,
margin: (x: 8pt, y: 4pt),
)
#rect(
width: 100%,
height: 100%,
fill: aqua,
)

columns
integerSettableSettable parameters can be customized for all following uses of the function with a set
rule.
set
rule.How many columns the page has.
#set page(columns: 2, height: 4.8cm)
Climate change is one of the most
pressing issues of our time, with
the potential to devastate
communities, ecosystems, and
economies around the world. It's
clear that we need to take urgent
action to reduce our carbon
emissions and mitigate the impacts
of a rapidly changing climate.

fill
The page's background color.
This instructs the printer to color the complete page with the given color. If you are considering larger production runs, it may be more environmentally friendly and cost-effective to source pre-dyed pages and not set this property.
#set page(fill: rgb("444352"))
#set text(fill: rgb("fdfdfd"))
*Dark mode enabled.*

header
The page's header.
The header is placed at in the top margin of each page.
- Content: The content will be placed in the header.
- A function: The function will be called with the page number (starting at one) as its only argument. The content it returns will be placed in the header.
none
: The header will be empty.
#set par(justify: true)
#set page(
margin: (x: 24pt, y: 32pt),
header: align(horizon + right, text(8pt)[_Exercise Sheet 3_]),
)
#lorem(18)

footer
The page's footer.
The footer is placed at in the bottom margin of each page.
- Content: The content will be placed in the footer.
- A function: The function will be called with the page number (starting at one) as its only argument. The content it returns will be placed in the footer.
none
: The footer will be empty.
#set par(justify: true)
#set page(
margin: (x: 24pt, y: 32pt),
footer: i => align(horizon + right,
text(8pt, numbering("I", i))
)
)
#lorem(18)

background
Content in the page's background.
This content will be placed behind the page's body. It can be used to place a background image or a watermark.
#set page(background: align(
center + horizon,
rotate(24deg,
text(18pt, fill: rgb("FFCBC4"))[*CONFIDENTIAL*]
),
))
= Typst's secret plans
In the year 2023, we plan to take over the world
(of typesetting).

foreground
Content in the page's foreground.
This content will overlay the page's body.
#set page(foreground: align(
center + horizon,
text(24pt)[🥸],
))
Reviewer 2 has marked our paper
"Weak Reject" because they did
not understand our approach...
