Skip to content
Skills Library
Documents & office · Learning & explanation

typst

/typst

Typst language reference - markup, math and code modes, set/show rules, layout, tables, templates, and PDF/HTML/PNG/SVG export, current to the latest stable release. Use when writing or editing a .typ file, fixing a Typst compile error, building a Typst table, figure or equation, writing a Typst template, exporting Typst to PDF/A, PDF/UA or HTML, migrating a document to a newer Typst release, or asking what changed in Typst. Do NOT use for Word (.docx) files - use Anthropic's document-skills; for filling existing PDF forms - use the documents plugin's pdf-processing-pro; for extracting text fr

Licence
MIT
Last repository change
04.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
10
Scripts
0
HTML comments
0
URLs in SKILL.md
2
Deprecation

No signals detected. Repository changed on 04.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Typst language reference - markup, math and code modes, set/show rules, layout, tables, templates, and PDF/HTML/PNG/SVG export, current to the latest stable release. Use when writing or editing a .typ file, fixing a Typst compile error, building a Typst table, figure or equation, writing a Typst template, exporting Typst to PDF/A, PDF/UA or HTML, migrating a document to a newer Typst release, or asking what changed in Typst. Do NOT use for Word (.docx) files - use Anthropic's document-skills; for filling existing PDF forms - use the documents plugin's pdf-processing-pro; for extracting text fr

Original author description

Typst language reference - markup, math and code modes, set/show rules, layout, tables, templates, and PDF/HTML/PNG/SVG export, current to the latest stable release. Use when writing or editing a .typ file, fixing a Typst compile error, building a Typst table, figure or equation, writing a Typst template, exporting Typst to PDF/A, PDF/UA or HTML, migrating a document to a newer Typst release, or asking what changed in Typst. Do NOT use for Word (.docx) files - use Anthropic's document-skills; for filling existing PDF forms - use the documents plugin's pdf-processing-pro; for extracting text fr

How it works

  1. Working on a document
  2. Quick reference
  3. Version currency
  4. Core concepts
  5. Common patterns
  6. Troubleshooting
  7. Export at a glance
  8. Reference files
Original SKILL.md headings · 250 lines, 1,202 words
SKILL.md preview
---
name: typst
description: Typst language reference - markup, math and code modes, set/show rules, layout, tables, templates, and PDF/HTML/PNG/SVG export, current to the latest stable release. Use when writing or editing a .typ file, fixing a Typst compile error, building a Typst table, figure or equation, writing a Typst template, exporting Typst to PDF/A, PDF/UA or HTML, migrating a document to a newer Typst release, or asking what changed in Typst. Do NOT use for Word (.docx) files - use Anthropic's document-skills; for filling existing PDF forms - use the documents plugin's pdf-processing-pro; for extracting text from an existing PDF - use the documents plugin's pdf-extract.
---

# Typst

Typst is a markup-based typesetting system with three modes (markup, math, code), a styling system of set and show rules, and a CLI that compiles `.typ` sources to PDF, PNG, SVG and (experimentally) HTML. This file carries the everyday syntax; the `references/` files carry depth.

## Working on a document

1. **Check the installed version** with `typst --version`. If it is older than 0.15, the removals table below does not apply yet - write for the installed version. If `typst` is missing, point the user to https://github.com/typst/typst#installation.
2. **Write or edit** using the quick reference below, opening a reference file when the task needs depth (see "Reference files").
3. **Compile** with `typst compile doc.typ` (or `typst watch doc.typ` while iterating). Done when it compiles with no errors and no deprecation warnings - those become errors in the next release. (HTML export always warns that it is experimental; that one is expected.) PDF/UA and PDF/A-a standards also fail on any image, figure or equation without `alt:` text.
4. **Fix errors** with the troubleshooting table. A message naming an unknown function, type or symbol is usually an API that 0.15 removed - check "Version currency" first.

## Quick reference

### Three modes

| Mode | Entry | Example |
|------|-------|---------|
| **Markup** | Default | `= Heading`, `*bold*`, `_italic_` |
| **Math** | `$...$` | `$sum_(i=0)^n x_i$` (block: `$ ... $` with spaces) |
| **Code** | `#` prefix | `#set text(font: "Arial")` |

### Markup

```typst
= Heading 1           // Heading (== for level 2, etc.)
*strong*              // Bold
_emphasis_            // Italic
`code`                // Raw/code
- item                // Bullet list
+ item                // Numbered list
/ Term: description   // Term list
@label                // Reference
<label>               // Label
https://...           // Auto-link
\                     // Line break
```

### Set rules (configure defaults)

```typst
#set page(paper: "a4", margin: 2cm)
#set text(font: "New Computer Modern", size: 11pt)
#set par(justify: true, leading: 0.65em)
#set heading(numbering: "1.1")
```

### Show rules (transform appearance)

```typst
// Show-set: apply a set rule to specific elements
#show heading: set text(navy)

// Transform: redefine appearance completely
#show heading: it => block[
  #counter(heading).display()
  #it.body
]

// Filter by properties
#show heading.where(level: 1): set align(center)

// Text replacement
#show "LaTeX": [Typst]
```

Rules apply from their position to the end of the enclosing scope (file or block).

### Common functions

```typst
#image("file.png", width: 50%)
#figure(content, caption: [Caption]) <label>
#table(columns: 3, [A], [B], [C], ...)
#grid(columns: (1fr, 2fr), [...], [...])
#align(center)[Content]
#box[inline] / #block[block-level]
#v(1em) / #h(1fr)              // Vertical/horizontal space
#divider()                     // Thematic break (0.15+)
#pagebreak()
#colbreak()
```

### Math

```typst
$x^2$                          // Inline
$ x^2 $                        // Block (spaces required)
$x_i$, $x^n$                   // Sub/superscript
$frac(a, b)$                   // Fraction (also a/b)
$sqrt(x)$, $root(3, x)$        // Roots
$vec(a, b, c)$                 // Vector
$mat(1, 2; 3, 4)$              // Matrix
$sum_(i=0)^n$, $integral_a^b$  // Big operators
$alpha$, $beta$, $RR$          // Greek/symbols
```

## Version currency

Current stable is 0.15 (0.15.1, July 2026). Pretraining knowledge of Typst may predate it - these APIs are gone and now hard-error:

| Removed | Use instead |
|---------|-------------|
| `path` element (shapes) | `curve` (`path("...")` is now the file-path type) |
| `pattern` type | `tiling` |
| `pdf.embed` | `pdf.attach` |
| `json.decode`, `csv.decode`, etc. | pass bytes to the top-level function: `json(bytes)` |
| `sect`, `sect.big` symbols | `inter`, `inter.big` |
| `plus.circle`, `times.circle` symbols | `plus.o`, `times.o` |
| Backslashes in file paths | forward slashes only, on all platforms |

Full 0.15 delta (new features, deprecations, migration steps): `references/whats-new.md`.

## Core concepts

**Content and functions.** Everything produces content. Call functions with `#function()` in markup and without `#` inside code. `[...]` holds markup; `{...}` holds code.

```typst
This is #text(red)[red] text.

#{
  let x = text(red)[red]
  [This is ] + x + [ text.]
}
```

**Context.** Location-dependent values need `context`:

```typst
#context counter(heading).get()      // Current heading number
#context here().page()               // Current page number
#context text.lang                   // Current language setting
```

**Templates** are functions that wrap the document body:

```typst
// template.typ
#let article(title: [], body) = {
  set page(paper: "a4")
  set text(11pt)
  align(center, text(17pt, strong(title)))
  body
}

// document.typ
#import "template.typ": article
#show: article.with(title: [My Article])
```

## Common patterns

### Academic paper

```typst
#set document(title: [Paper Title], author: "Author Name")
#set page(paper: "us-letter", margin: 1in, numbering: "1")
#set text(font: "New Computer Modern", size: 12pt)
#set par(justify: true, first-line-indent: 1em)
#set heading(numbering: "1.1")
#show heading.where(level: 1): set text(size: 14pt)

#align(center)[
  #text(17pt, strong[Paper Title])
  #v(1em)
  Author Name \
  Institution
]

= Introduction
#lorem(100)
```

### Two-column layout with full-width title

```typst
#set page(columns: 2)

#place(top + center, float: true, scope: "parent")[
  #align(center, text(17pt, strong[Title]))
]

= Section
Content flows in columns...
```

### Custom heading style

```typst
#show heading.where(level: 1): it => {
  set text(size: 14pt, weight: "bold")
  v(1em)
  block[
    #counter(heading).display("I.")
    #h(0.5em)
    #smallcaps(it.body)
  ]
  v(0.5em)
}
```

### Figure with caption and cross-reference

```typst
#figure(
  image("diagram.svg", width: 80%),
  caption: [System architecture overview],
) <fig:arch>

As shown in @fig:arch, the system...
```

Prefer semantic elements (`= Heading`, `figure`, `table`) over hand-sized `text` calls - tagged PDF, HTML export and show rules all key off the element.

## Troubleshooting

| Error | Cause | Fix |
|-------|-------|-----|
| "unknown variable" | Typo or scope issue | Check spelling; set/show rules and `let` bindings only apply forward and within their block |
| "unknown variable: sect" (or other symbol) | Symbol removed or renamed in 0.15 | Check "Version currency" and `references/whats-new.md` |
| "expected content" | Code where markup expected | Wrap in a `[...]` content block |
| "expected expression" | Markup where code expected | Add the `#` prefix or use a code block |
| "cannot access" | Context required | Wrap in a `context` expression |
| "layout did not converge" | Self-referential context/state/counter | Read the diagnostics - they list which elements changed per iteration |

To inspect a value, render `#repr(value)`; to isolate a failure, cut the document down until the error disappears.

## Export at a glance

- **PDF** (default): metadata via `#set document(...)`; tagged for accessibility automatically; PDF/A and PDF/UA via `--pdf-standard` (comma-separate to target several, e.g. `a-2a,ua-1`); output minified unless `--pretty`.
- **HTML** (experimental): `--features html --format html`; `target()` works without the flag; equations become MathML.
- **PNG/SVG**: `--ppi` sets PNG resolution; one file per page; no text accessibility.
- **Bundle** (experimental): `--features bundle` emits several output files from one project.

## Reference files

Open the file that matches the task; each is self-contained.

| File | Open when |
|------|-----------|
| `references/syntax.md` | Markup escapes, code-mode syntax, types, operators, loops, closures |
| `references/styling.md` | Writing non-trivial set/show rules, selectors (`where`, `within`), templates |
| `references/math.md` | Equations beyond the quick reference: alignment, symbols, `lr`, numbering |
| `references/layout.md` | Page setup, margins, headers/footers, grids, columns, placement, spacing |
| `references/tables.md` | Tables with spans, strokes, fills, headers repeating across pages, data-driven rows |
| `references/functions.md` | Looking up parameters of text, list, bibliography, shapes (`curve`), data loading |
| `references/export.md` | CLI flags, HTML/SVG/PNG specifics, bundle export, fonts, `typst eval` |
| `references/accessibility.md` | PDF/UA, alt text, tagged PDF, accessible tables and maths |
| `references/whats-new.md` | Migrating an older document, or the user asks what changed in 0.15 |
Files in this package (10)
  • SKILL.md 9 KB
  • references/accessibility.md 7 KB
  • references/export.md 9 KB
  • references/functions.md 8 KB
  • references/layout.md 9 KB
  • references/math.md 10 KB
  • references/styling.md 8 KB
  • references/syntax.md 8 KB
  • references/tables.md 7 KB
  • references/whats-new.md 7 KB

Versions

RepositoryScoreLicence
This page · henkisdabro/wookstar-claude-plugins100MIT
autonomous-ai/openharness100MIT
lucifer1004/claude-skill-typst100MIT
ChanMeng666/typst-claude-skill100MIT

Database snapshot: 13.11.2026 · package version 1c6638f32572 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100typst-authoring
    This skill should be used when the user asks to "write Typst", "create a Typst document", "format in Typst", "convert to Typst", "Typst syntax", "Typst template", "Typst math", "Typst table", or works with .typ files. Provides comprehensive Typst markup, scripting, math, layout,…
  • 100typst-creator
    Create, update, review, migrate, or diagnose Typst (.typ) source for documents, reports, papers, and presentations. Use for Typst markup, styling, scripting, math, layout, bibliography, and compiler/export issues. Resolve the compiler and generate source for stable Typst 0.13.0…
  • 100typst-writer
    Write correct and idiomatic Typst code for document typesetting. Use when creating or editing Typst (.typ) files, working with Typst markup, or answering questions about Typst syntax and features. Focuses on avoiding common syntax confusion (arrays vs content blocks, proper…
  • 95latex-to-typst
    Translates LaTeX documents (.tex) to Typst (.typ), focusing on article-class documents. Use when asked to convert, port, migrate, or translate LaTeX to Typst. Covers document structure, text formatting, page layout, math equations and symbols, figures, tables, TikZ-to-CeTZ…
  • 100pdf-generation
    把 Markdown 排成 PDF(Typst 排版,不装 LaTeX):报告、白皮书、信函、书稿、教材、小说、笔记。当用户要把 .md 转成 PDF、按某种文档类型排版、或调整已有 PDF 的版式与观感时使用。
  • 100document-export
    Markdown to Word and PDF that meets submission rules: write the document once in Markdown, export DOCX with a generated reference document (exact font, size, heading style, line spacing, page size, margins) and PDF through pandoc's Typst engine with the same settings, then check…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.