What is the equivalent of Latex \section* in Typst?

Hi everyone,

I’m using the = of heading to number my sections and I want the Introduction unnumbered. Is there an equivalent of \section* in Typst ?

Thanks in advance !

Hi, welcome to the Typst forum!

The most direct equivalent is

#heading(numbering: none)[Title text]

and for \subsection*:

#heading(depth: 2, numbering: none)[Title text]

You could make this a bit more convenient with a function, for example

#let section-nonum = heading.with(numbering: none)
#let subsection-nonum = heading.with(depth: 2, numbering: none)

// Use like this
#section-nonum[Title text]
#subsection-nonum[Title text]

Another approach is to change the numbering locally, in the scope of a markup block:

= Section that gets numbered

#[
  // In this markup block we disable numbering
  #set heading(numbering: none)

  = Section that doesn't get numbered
]

For a more advanced solution with nicer syntax, see How to have headings without numbers in a fluent way?

It’s perfect, thanks !

1 Like