I am new to Typst and using it for preparing assignments for my masters course work … when i set the page number using set page(numbering)
i noticed that contents of my first page completely moved to second page and only the title remained in the first page. it seems that the first page is automatically treated as a title page when we switch on numbering…
Since my document does not need a title page… how do i set this off …
Snippets of my typst code is give below…
#set text(
font: "New Computer Modern",
size: 13pt
)
#let title = [Tutorial No.1]
#let author = [Jaivishnu K.S]
#align(center, text(16pt)[
*#title*
])
#align(center, text(13pt)[
#author])
#set enum(numbering: "1.a)")
#set par(justify: true,leading:3em,spacing: 2em)
#set heading(numbering: "1.a)")
#set page(numbering: "1")
#v(10pt)
+ Evaluate the following
+ $overline(b) dot overline(c)$ where b = (1,4,17) and c=(-4,-3,1) \ $overline(b) dot overline(c) = b_i c_i = -4-12+17 = 1$
Hi @jaivishnuks, welcome to the community!
Typst code is interpreted line-by-line, therefore, when using the page
function after the code for title
like this:
#align(center, text(16pt)[#title])
// [...]
#set page(numbering: "1")
it only affects the elements which come after.
It should be noted that whenever you set a new page layout, the content which comes after the page
function is displayed starting on a new page.
This is good for when you only want certain pages to have different layouts. For example, when creating a cover page, you may want the margins for that first page to be set differently, and you may also not want any numbering on that page. You would write the code something similar to this:
#set page(margin: (x: 3in, y: 2in)) // page settings for cover (numbering is not displayed)
#lorem(180)
#set page(margin: 2.5cm, numbering: "1") // page settings for the rest of the document (numbering begins now)
#lorem(2000)
As shown above, the cover page has a different page margin than the rest of the document and does not include numbering like the rest of the document.
For your situation, placing the code for the page layout at the top would suffice.
I hope this was helpful and you have a fantastic time writing in Typst!
1 Like
Hi @jaivishnuks, welcome and thank you for your question! I have changed your post’s title to bring it in line with the question guidelines and thus make it easier to understand from the title:
Good titles are questions you would ask your friend about Typst.
I also formatted your code a bit; clicking on the pencil symbol you should be able to see what I changed, and the question guidelines also provide some guidance on how to show Typst code.
1 Like