I would like to be able to set the top margin value differently on every page AFTER the first page.
Page 1 would have a top margin value of 1cm, every other pager after that would be set to 2.5cm.
TIA
I would like to be able to set the top margin value differently on every page AFTER the first page.
Page 1 would have a top margin value of 1cm, every other pager after that would be set to 2.5cm.
TIA
Hello Glenn,
You can do that easily by adding another #set
directive after your first page.
#set page(margin: (top: 1cm))
= Title page
#pagebreak()
#set page(margin: (top: 2.5cm))
= Page 2
On another note, please be careful to follow the guidelines at FAQ - Typst Forum . Notably:
Best
The way shown above works when you’re fine with an explicit page break. If that’s a problem, you can simply add negative vertical spacing at the start of your document like this: v(-1.5cm)
.
This only works for the first page of the document though. For other pages, it is not possible at the moment. See this question: How to get differently-sized header or footer depending on page number?
@laurmaedje The link to the other question posted shows how to change the output for odd and even page numbers. I did read it and tried to adapt it to my use case but to no avail.
Probably just me not understanding fully. Thank you though. Appreciate it.
@quachpas Apologies. I believed I was posting in the questions category. That would be me not fully paying attention. Your solution worked. Thank you.
You did nothing wrong here, but often it’s useful to link to other questions that you have already looked at and say how they didn’t solve your issue. This can help others understand better where your problem is different from the previous ones.
Glad you have a solution! Unless you expect that someone else could give an even better answer to the question, could you mark @quachpas’ answer as the solution? This will help others find it quicker.
I don’t know why this wasn’t mentioned, but you don’t need an explicit pagebreak()
right before set page()
, generally speaking. I think there are cases where set page()
won’t automatically create a page break. One example (and maybe the only one?) is when you write set page()
(but then why would you write it at all, right?).
That means this would work the same way as the initial solution:
#set page(margin: (top: 1cm))
= Title page
#set page(margin: (top: 2.5cm))
= Page 2