Use this skill whenever the user wants to create, compile, or work with Typst documents (.typ files). Triggers include: any mention of 'Typst', '.typ', or requests to create beautifully typeset documents, academic papers, reports, letters, resumes, or slide decks using Typst. Also use when the user wants a LaTeX alternative, mentions typesetting with markup, asks to generate PDFs from Typst source, or needs help with Typst syntax (set rules, show rules, math mode, tables, figures, bibliography). Use this skill for converting LaTeX to Typst, creating Typst templates, or any document generation where Typst is explicitly requested or would be the best tool. If the user says "make me a PDF" and the content is academic, mathematical, or involves complex typesetting, consider suggesting Typst. Do NOT use for general Word docs (.docx), PowerPoint, or simple markdown files.
Typst is a modern markup-based typesetting system — a powerful, fast alternative to LaTeX that produces high-quality PDFs. This skill helps Claude create, compile, and deliver Typst documents.
Typst must be installed before use. Run this installation step first:
cd /tmp && curl -sL "https://github.com/typst/typst/releases/download/v0.14.2/typst-x86_64-unknown-linux-musl.tar.xz" -o typst.tar.xz && tar -xf typst.tar.xz && cp typst-x86_64-unknown-linux-musl/typst /usr/local/bin/ && typst --version
If typst is already installed (which typst succeeds), skip this step.
.typ source file in /home/claude/typst compile document.typ document.pdf/mnt/user-data/outputs/.typ.pdfAlways compile and verify that Typst exits without errors before delivering. If there are warnings
(like unknown fonts), fix them — use fonts from the available set (check with typst fonts).
Typst has three modes: markup, math, and code. In markup, # enters code mode.
In math ($ ... $), function calls don't need #.
#set page(paper: "a4", margin: (top: 2.5cm, bottom: 2.5cm, left: 2cm, right: 2cm))
#set text(font: "Libertinus Serif", size: 11pt, lang: "en")
#set par(justify: true, leading: 0.65em, first-line-indent: 1.2em)
#set heading(numbering: "1.1")
For Korean documents, use "Noto Sans CJK KR" as the font. For Japanese, "Noto Sans CJK JP".
Always check available fonts with typst fonts before specifying.
= Top Level Heading
== Second Level
=== Third Level
*bold text*
_emphasized text_
`inline code`
#underline[underlined]
#strike[strikethrough]
#highlight[highlighted]
#text(fill: blue)[colored text]
#smallcaps[Small Caps]
- Unordered item
- Nested item
+ Ordered item
+ Another item
/ Term: Definition
/ Another: Its definition
#link("https://typst.app")[Typst Website]
= Introduction <intro>
See @intro for details.
#figure(
image("photo.jpg", width: 80%),
caption: [A descriptive caption.],
) <fig-label>
#table(
columns: (1fr, 2fr, 1fr),
align: (left, center, right),
table.header([*Name*], [*Description*], [*Value*]),
[Alpha], [First item], [100],
[Beta], [Second item], [200],
)
For complex tables with merged cells, use table.cell(colspan: 2)[...] or table.cell(rowspan: 2)[...].
Inline math: $x^2 + y^2 = z^2$
Block math (add spaces inside $):
$ integral_0^oo e^(-x^2) dif x = sqrt(pi) / 2 $
Key math syntax:
x_i Superscript: x^2a / b or frac(a, b)sqrt(x) or root(n, x)sum_(i=0)^nalpha, beta, gamma, pi, theta, etc.dot, times, plus.minus, approx, !=chevron.l ... chevron.r (NOT angle.l/angle.r — deprecated)partial (NOT diff — deprecated in 0.14+)dif for $dx$ in integralsmat(1, 2; 3, 4)vec(x, y, z)cases(x &"if" x > 0, -x &"otherwise")& and \$ sum_(k=0)^n k &= 1 + 2 + dots + n \
&= (n(n+1)) / 2 $
Set rules change default properties:
#set text(size: 12pt)
#set page(numbering: "1")
#set enum(numbering: "a)")
Show rules transform how elements appear:
#show heading.where(level: 1): it => {
set text(size: 16pt, weight: "bold")
block(above: 1.5em, below: 0.8em)[#it.body]
}
// Make all links blue and underlined
#show link: set text(fill: blue)
#show link: underline
```python
def hello():
print("Hello, Typst!")
```
#pagebreak()
#columns(2)[
Content in two columns.
#colbreak()
Second column.
]
#bibliography("refs.bib", style: "ieee")
// Citation in text:
As shown by @authorkey.
#let alert(body, title: "Note") = {
block(
fill: luma(230),
inset: 12pt,
radius: 4pt,
width: 100%,
)[
*#title:* #body
]
}
#alert[This is a note.]
#alert(title: "Warning")[Be careful!]
#import "template.typ": conf
#show: conf.with(title: "My Paper", authors: ("Author",))
// Import from Typst Universe packages:
#import "@preview/cetz:0.3.4": canvas, draw
For common document types, read the reference file at references/templates.md for
ready-to-use templates covering: academic papers, letters, resumes, slide presentations, and reports.
These fonts are typically available in the Claude environment:
Libertinus Serif, DejaVu Serif, Liberation Serif, Latin Modern Roman, FreeSerifDejaVu Sans, Liberation Sans, Latin Modern Sans, FreeSansDejaVu Sans Mono, Liberation Mono, Latin Modern Mono, FreeMonoNoto Sans CJK KR, Noto Sans CJK JP, Noto Sans CJK SC, Noto Sans CJK TCDejaVu Math TeX Gyre, Latin Modern MathNoto Color EmojiAlways verify with typst fonts | grep -i "font-name" before using a font.
# Basic PDF
typst compile doc.typ
# Explicit output path
typst compile doc.typ output.pdf
# Specify format
typst compile doc.typ output.svg --format svg
typst compile doc.typ output.png --format png
# Custom font path
typst compile --font-path ./fonts doc.typ
# Pass input variables
typst compile --input name="Alice" doc.typ
typst fonts for available names. Names are case-sensitive..typ file's directory. Use --root to change.Noto Sans CJK KR.#set par(justify: true) for professional-looking paragraphs#set text(lang: "ko") (or appropriate language) for correct hyphenation#show math.equation: set text(font: "Latin Modern Math") for consistent math fonts#set heading(numbering: "1.1") and #set math.equation(numbering: "(1)")#set page(numbering: "1", number-align: center + bottom) for page numbers@fig-label