pageElementElementElement functions can be customized with set and show rules.
set and 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.
The Guide for Page Setup explains how to use this and related functions to set up a document with many examples.
Example
#set page("us-letter")
There you go, US friends!

ParameterParameterParameters are input values for functions. Specify them in parentheses after the function name.
page(,,,,,,,fill:,,,,,,,,,,)->paperSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
paperset rule, changing the default value used thereafter.A standard paper size to set width and height.
This is just a shorthand for setting width and height and, as such,
cannot be retrieved in a context expression.
Available string values
a0Produces a paper of the respective size.
a1Produces a paper of the respective size.
a2Produces a paper of the respective size.
a3Produces a paper of the respective size.
a4Produces a paper of the respective size.
a5Produces a paper of the respective size.
a6Produces a paper of the respective size.
a7Produces a paper of the respective size.
a8Produces a paper of the respective size.
a9Produces a paper of the respective size.
a10Produces a paper of the respective size.
a11Produces a paper of the respective size.
iso-b1Produces a paper of the respective size.
iso-b2Produces a paper of the respective size.
iso-b3Produces a paper of the respective size.
iso-b4Produces a paper of the respective size.
iso-b5Produces a paper of the respective size.
iso-b6Produces a paper of the respective size.
iso-b7Produces a paper of the respective size.
iso-b8Produces a paper of the respective size.
iso-c3Produces a paper of the respective size.
iso-c4Produces a paper of the respective size.
iso-c5Produces a paper of the respective size.
iso-c6Produces a paper of the respective size.
iso-c7Produces a paper of the respective size.
iso-c8Produces a paper of the respective size.
din-d3Produces a paper of the respective size.
din-d4Produces a paper of the respective size.
din-d5Produces a paper of the respective size.
din-d6Produces a paper of the respective size.
din-d7Produces a paper of the respective size.
din-d8Produces a paper of the respective size.
sis-g5Produces a paper of the respective size.
sis-e5Produces a paper of the respective size.
ansi-aProduces a paper of the respective size.
ansi-bProduces a paper of the respective size.
ansi-cProduces a paper of the respective size.
ansi-dProduces a paper of the respective size.
ansi-eProduces a paper of the respective size.
arch-aProduces a paper of the respective size.
arch-bProduces a paper of the respective size.
arch-cProduces a paper of the respective size.
arch-dProduces a paper of the respective size.
arch-e1Produces a paper of the respective size.
arch-eProduces a paper of the respective size.
jis-b0Produces a paper of the respective size.
jis-b1Produces a paper of the respective size.
jis-b2Produces a paper of the respective size.
jis-b3Produces a paper of the respective size.
jis-b4Produces a paper of the respective size.
jis-b5Produces a paper of the respective size.
jis-b6Produces a paper of the respective size.
jis-b7Produces a paper of the respective size.
jis-b8Produces a paper of the respective size.
jis-b9Produces a paper of the respective size.
jis-b10Produces a paper of the respective size.
jis-b11Produces a paper of the respective size.
sac-d0Produces a paper of the respective size.
sac-d1Produces a paper of the respective size.
sac-d2Produces a paper of the respective size.
sac-d3Produces a paper of the respective size.
sac-d4Produces a paper of the respective size.
sac-d5Produces a paper of the respective size.
sac-d6Produces a paper of the respective size.
iso-id-1Produces a paper of the respective size.
iso-id-2Produces a paper of the respective size.
iso-id-3Produces a paper of the respective size.
asia-f4Produces a paper of the respective size.
jp-shiroku-ban-4Produces a paper of the respective size.
jp-shiroku-ban-5Produces a paper of the respective size.
jp-shiroku-ban-6Produces a paper of the respective size.
jp-kiku-4Produces a paper of the respective size.
jp-kiku-5Produces a paper of the respective size.
jp-business-cardProduces a paper of the respective size.
cn-business-cardProduces a paper of the respective size.
eu-business-cardProduces a paper of the respective size.
fr-tellièreProduces a paper of the respective size.
fr-couronne-écritureProduces a paper of the respective size.
fr-couronne-éditionProduces a paper of the respective size.
fr-raisinProduces a paper of the respective size.
fr-carréProduces a paper of the respective size.
fr-jésusProduces a paper of the respective size.
uk-briefProduces a paper of the respective size.
uk-draftProduces a paper of the respective size.
uk-foolscapProduces a paper of the respective size.
uk-quartoProduces a paper of the respective size.
uk-crownProduces a paper of the respective size.
uk-book-aProduces a paper of the respective size.
uk-book-bProduces a paper of the respective size.
us-letterProduces a paper of the respective size.
us-legalProduces a paper of the respective size.
us-tabloidProduces a paper of the respective size.
us-executiveProduces a paper of the respective size.
us-foolscap-folioProduces a paper of the respective size.
us-statementProduces a paper of the respective size.
us-ledgerProduces a paper of the respective size.
us-oficioProduces a paper of the respective size.
us-gov-letterProduces a paper of the respective size.
us-gov-legalProduces a paper of the respective size.
us-business-cardProduces a paper of the respective size.
us-digestProduces a paper of the respective size.
us-tradeProduces a paper of the respective size.
newspaper-compactProduces a paper of the respective size.
newspaper-berlinerProduces a paper of the respective size.
newspaper-broadsheetProduces a paper of the respective size.
presentation-16-9Produces a paper of the respective size.
presentation-4-3Produces a paper of the respective size.
"a4"The width of the page.
Show example
#set page(
width: 3cm,
margin: (x: 0cm),
)
#for i in range(3) {
box(square(width: 1cm))
}

595.28ptThe 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.
841.89ptflippedSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
flippedset rule, changing the default value used thereafter.Whether the page is flipped into landscape orientation.
Show example
#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

falsemarginSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
marginset rule, changing the default value used thereafter.The page's margins.
auto: The margins are set automatically to 2.5/21 times the smaller dimension of the page. This results in 2.5cm margins for an A4 page.- A single length: The same margin on all sides.
- 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.inside: The margin at the inner side of the page (where the binding is).outside: The margin at the outer side of the page (opposite to the binding).x: The horizontal margins.y: The vertical margins.rest: The margins on all sides except those for which the dictionary explicitly sets a size.
The values for left and right are mutually exclusive with
the values for inside and outside.
Show example
#set page(
width: 3cm,
height: 4cm,
margin: (x: 8pt, y: 4pt),
)
#rect(
width: 100%,
height: 100%,
fill: aqua,
)

autoOn which side the pages will be bound.
auto: Equivalent toleftif the text direction is left-to-right andrightif it is right-to-left.left: Bound on the left side.right: Bound on the right side.
This affects the meaning of the inside and outside options for
margins.
autocolumnsSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
columnsset rule, changing the default value used thereafter.How many columns the page has.
If you need to insert columns into a page or other container, you can
also use the columns function.
Show example
#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.

1The page's background fill.
Setting this to something non-transparent instructs the printer to color the complete page. 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.
When set to none, the background becomes transparent. Note that PDF
pages will still appear with a (usually white) background in viewers,
but they are actually transparent. (If you print them, no color is used
for the background.)
The default of auto results in none for PDF output, and
white for PNG and SVG.
Show example
#set page(fill: rgb("444352"))
#set text(fill: rgb("fdfdfd"))
*Dark mode enabled.*

autoHow to number the pages.
If an explicit footer (or header for top-aligned numbering) is
given, the numbering is ignored.
Show example
#set page(
height: 100pt,
margin: (top: 16pt, bottom: 24pt),
numbering: "1 / 1",
)
#lorem(48)

noneA supplement for the pages.
For page references, this is added before the page number.
Show example
#set page(numbering: "1.", supplement: [p.])
= Introduction <intro>
We are on #ref(<intro>, form: "page")!

autonumber-alignSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
number-alignset rule, changing the default value used thereafter.The alignment of the page numbering.
If the vertical component is top, the numbering is placed into the
header and if it is bottom, it is placed in the footer. Horizon
alignment is forbidden. If an explicit matching header or footer is
given, the numbering is ignored.
Show example
#set page(
margin: (top: 16pt, bottom: 24pt),
numbering: "1",
number-align: right,
)
#lorem(30)

center + bottomThe page's header. Fills the top margin of each page.
- Content: Shows the content as the header.
auto: Shows the page number if anumberingis set andnumber-alignistop.none: Suppresses the header.
Show example
#set par(justify: true)
#set page(
margin: (top: 32pt, bottom: 20pt),
header: [
#set text(8pt)
#smallcaps[Typst Academy]
#h(1fr) _Exercise Sheet 3_
],
)
#lorem(19)

autoheader-ascentSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
header-ascentset rule, changing the default value used thereafter.The amount the header is raised into the top margin.
30% + 0ptThe page's footer. Fills the bottom margin of each page.
- Content: Shows the content as the footer.
auto: Shows the page number if anumberingis set andnumber-alignisbottom.none: Suppresses the footer.
For just a page number, the numbering property typically suffices. If
you want to create a custom footer but still display the page number,
you can directly access the page counter.
Show example
#set par(justify: true)
#set page(
height: 100pt,
margin: 20pt,
footer: context [
#set align(right)
#set text(8pt)
#counter(page).display(
"1 of I",
both: true,
)
]
)
#lorem(48)

autofooter-descentSettableSettableSettable parameters can be set using the set rule, changing the default value used thereafter.
footer-descentset rule, changing the default value used thereafter.The amount the footer is lowered into the bottom margin.
30% + 0ptContent 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.
Show example
#set page(background: 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).

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

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