How to alternate page margins for printing and binding as a book?

I am currently working on my master’s thesis, and I need a layout suitable for printing and binding as a book.

This requires that each chapter alternates the page margins: the first page should have a larger left margin, the second page a larger right margin, and so on).

Is there an easy way to achieve this without manually adjusting each page with a #pad()?

Since the chapters don’t follow a consistent page pattern, it’s not possible to programmatically assign every odd page to the left and every even page to the right.

You can use the following rule:

#set page(margin: (inside: 2.5cm, outside: 2cm, y: 1.75cm))

See Page setup guide – Typst Documentation for more details.

2 Likes

Oh wow, I didn’t see that. Much thanks.

Hey @Patrick_K! I’ve changed your question post’s title to better fit our guidelines: How to post in the Questions category

For future posts, please make sure your title is a question you’d ask to a friend about Typst. :wink: