Typst Guide

Typst Document Setup

#set page(...), #set text(...), #set par(...), #set heading(...). Four lines and your document is configured.

A complete academic-paper preamble

#set page(
  paper: "us-letter",
  margin: 1in,
  numbering: "1",
)

#set text(
  font: "Times New Roman",
  size: 12pt,
  lang: "en",
)

#set par(
  leading: 1em,        // line spacing within paragraph
  first-line-indent: 1em,
  justify: true,
)

#set heading(numbering: "1.")

// Title block
#align(center)[
  #text(size: 18pt, weight: "bold")[Your Paper Title]

  #text(size: 12pt)[Author Name]

  #text(size: 10pt)[Affiliation]
]

#v(1em)

= Introduction

Body text here. The first line of each paragraph is indented 1em.

= Methods

More text...

#bibliography("references.bib", style: "ieee")

Common settings, by category

Page

OptionEffect
paper: "us-letter"Standard US 8.5x11
paper: "a4"European A4
margin: 1inAll sides
margin: (left: 1.5in, right: 1in, y: 1in)Asymmetric
numbering: "1"Page numbers
columns: 2Two-column layout

Text

OptionEffect
font: "Times New Roman"Body font
size: 12ptDefault text size
lang: "en"Hyphenation language
weight: 400Default weight

Paragraph

OptionEffect
leading: 1emLine spacing within paragraph
first-line-indent: 1emParagraph indent
justify: trueJustified text
Get a pre-configured Typst project

TypeTeX includes academic templates with the right #set rules already configured for IEEE, ACM, NeurIPS, ICML, theses, and more. Pick a template, focus on writing.

Frequently Asked Questions

How do I set up a Typst document?

Use #set rules at the top of your document. Common ones: #set page(paper: "us-letter", margin: 1in) for layout, #set text(font: "Times New Roman", size: 12pt) for fonts, #set par(leading: 1em, justify: true) for paragraphs, #set heading(numbering: "1.") for section numbers.

How do I set the paper size and margins in Typst?

#set page(paper: "us-letter", margin: 1in). Paper options: "us-letter", "us-legal", "a4", "a5", "b5". Margins can be uniform (margin: 1in) or per-side (margin: (left: 1.5in, right: 1in, y: 1in)).

How do I number sections in Typst?

#set heading(numbering: "1.") gives 1, 2, 3 numbering for top-level. "1.1" gives 1.1, 1.2 for two levels. "I." for Roman numerals, "A." for letters. Custom: "1.1.a" mixes integers and letters across nesting levels.

How do I set line spacing in Typst?

#set par(leading: 1em) controls the space between lines within a paragraph. Default is 0.65em. For 'double-spaced', use leading: 1.5em or 2em. For paragraph-to-paragraph spacing: #set block(spacing: 1em).

How do I add page numbers in Typst?

#set page(numbering: "1") for simple Arabic. "i" for lowercase Roman, "I" for uppercase. "1 / 1" shows 'page X of Y'. To suppress on the first page (title page): #set page(numbering: none) for that page using #place or #set page rules scoped to a section.

How do I set headers and footers?

#set page(header: [Your Title], footer: [Page #counter(page).display()]). For just-on-even pages or first-page suppression, pass a function: header: (page) => if page > 1 { ... }. The header/footer take any content — text, formatting, custom layouts.

What's the equivalent of LaTeX's \documentclass{article} in Typst?

Typst doesn't have document classes — it has 'templates' which are reusable styled wrappers. Use #import "@preview/journal-template:1.0": * to import a published template, or write your own setup using #set rules. The Typst Universe (typst.app/universe) hosts community templates.

How do I make a title and abstract block?

Manually with formatted text: #align(center)[#text(size: 18pt, weight: "bold")[Your Title]\ #text(size: 12pt)[Author Name]]. Or use a template's title() function. Most academic templates expose #title, #author, #abstract that handle the formatting consistently.

How is Typst document setup simpler than LaTeX preamble?

LaTeX preamble: \documentclass + \usepackage{geometry} + \setlength{} + \usepackage{fontspec} + \setmainfont{} + \usepackage{titlesec} + \renewcommand{}... 10+ lines, multiple packages, ordering matters. Typst: 4-6 lines of #set rules, no package imports for built-ins, order doesn't matter (unless you intentionally want it to).

More Typst guides