typst

Generates, compiles, and visually verifies Typst documents using local templates and conventions.

Updated Mar 29, 2024
One-click install
npx skills add https://github.com/petobens/ai-harness --skill typst-petobens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typst
Source: https://github.com/petobens/ai-harness/tree/main/skills/typst
Command: npx skills add https://github.com/petobens/ai-harness --skill typst-petobens

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Writing Typst documents by hand often leads to inconsistent typography, broken cross-references, unresolved citations, and layout defects that only appear in the rendered PDF. This Skill enforces shared local templates and conventions so articles, books, slide decks, and standalone figures compile correctly and render as intended. ## Core Features & Use Cases - Template-driven authoring: Uses canonical local packages (latex-article, mutt-article, latex-book, mutt-slides, standalone) with semantic helpers for headings, equations, statements, figures, tables, citations, and indexes. - Compile and verify workflow: Formats sources with typstyle, compiles with typst, then inspects metadata, text, outlines, fonts, and rendered pages with pdfinfo, pdftotext, qpdf, pdffonts, and pdftoppm. - Use Case: When writing an academic paper with numbered equations, subfigures, and a Hayagriva bibliography, the Skill applies the correct label prefixes, numbering rules, and bibliography reader, then renders pages to confirm cross-reference numbers and float placement are correct. ## Quick Start Use the typst skill to create an academic article from the latex-article template with a numbered equation and a Hayagriva bibliography, then compile and visually verify the output.

Frequently Asked Questions about typst

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a Typst academic article with numbered equations?

Import @local/latex-article:0.1.0 and apply latex-article.with(...), then use #equation(...) with a label like <eq:linear_relation> for numbered displays. Raw display math stays unnumbered; the template handles section-aware numbering and cross-references automatically.

How do I compile a Typst document that imports files outside its directory?

Run typst compile with the --root flag set to the project root, for example typst compile --root PROJECT_ROOT source.typ /tmp/output.pdf. Compile every affected entry point, and compile the enclosing main.typ rather than an included chapter in isolation.

Should I use Hayagriva YAML or BibTeX for Typst bibliographies?

Prefer Hayagriva YAML (.yml or .yaml) for new bibliography sources and preserve existing .bib files unless conversion is requested. Both use the same #bibliography call, but articles and slides must pass a document-local bibliography-read reader so Retrofit resolves files correctly.

Why does my Typst PDF show the wrong font after changing font family?

Run pdffonts on the output PDF to check the embedded face, then use fc-match or fc-query to resolve the installed family and style. Do not infer the selected font from visual similarity alone before adjusting Typst styling.

When should I not shrink text to fit content on a Typst slide?

Never shrink slide text to make dense content fit; treat every slide as a hard frame and edit or split the content instead. Accept no overflow, clipping, collisions, or title-chip overlap, and inspect every changed slide and overlay state.