Generate idiomatic Typst (.typ) code, edit existing Typst files, and answer Typst syntax questions. Use when working with Typst files (*.typ) or when the user mentions Typst markup, document creation, or formatting.
This skill helps agents generate, edit, and reason about Typst documents. It provides quick‑start examples, detailed workflows, and links to the full Typst documentation (guides, tutorials, reference).
#set document(title: "My Document", author: "Author Name")
#set page(numbering: "1")
#set text(lang: "en")
// Enable paragraph justification and character-level justification
#set par(
justify: true,
justification-limits: (
tracking: (min: -0.012em, max: 0.012em),
spacing: (min: 75%, max: 120%),
)
)
#title[My Document]
= Heading 1
This is a paragraph in Typst.
== Heading 2
#lorem(50)
.typset rule, show rule, and custom themes.docs/guides/*.mddocs/tutorial/*.mddocs/reference/**/*.mddocs/ folder before generating code.Read/Grep/Glob on the paths above)..typ source according to the user's request.typst compile (if tool access is allowed)..typ content and optionally a rendered preview (PDF/HTML).Critical distinctions:
(item1, item2) (parentheses). See docs/reference/data-structures.md.(key: value, key2: value2) (parentheses with colons). See docs/reference/foundations/dictionary.md.[markup content] (square brackets). See docs/reference/foundations/content.md.[] for arrays (use () instead).arr[0] (use arr.at(0)).# prefix for code in markup context.[] with code blocks {}.color.hsl instead of just hsl).\begin{...}, \section, or other LaTeX commands).tabular does not exist; use table).When working on large projects, consider organizing the project across multiple files.
#include "file.typ" to split into multiple filesIf you see "unknown font family" warnings, remove the font specification to use system defaults. Note: Font warnings don't prevent compilation; the document will use fallback fonts.
If import fails with "package not found":
@preview/package:version syntax.Common fixes:
#{ } or use proper syntax.# prefix in markup context.() for both, dictionaries need key: value, singleton arrays are (elem,).