How can I adjust the vertical margin for different pages?

I need to adjust the vertical margin for each page in Typst to maintain consistent formatting according to the content. Specifically, I want the y-axis margin to be set to 3 cm for the first page, and then reset to 1 cm for the subsequent pages.

#set page(
  paper: "a4",
  flipped: true,
  margin: (x: 1cm, y: 3cm),
  numbering: "1",
  number-align: center,
)

If the content flows from the first page into the subsequent pages, you are unfortunately out of luck (How to get differently-sized header or footer depending on page number? - #8 by laurmaedje).

However, if the first page is like a title page, whose content is separate from the rest of the document, you have two options:

  • Use a #page(margin: ...)[ ... ] explicitly for the first page instead of a set rule, so that the options are only applied for that page
  • Write another #set page(...) rule right after the first page, so that subsequent pages follow the new properties.
1 Like

This is a duplicate, more or less of Can you have different values for the top margin AFTER the first page?.
Also, don’t hesitate to phrase the post title as a question, and add tags such as layout @ShaiQ! See How to post in the Questions category.

Duplicate of

Thanks for pointing it out @quachpas!