/chanmeng-typst:chanmeng-typstfrom chanmeng-typst
Generates professional PDF documents using the Typst typesetting system. Handles resumes, CVs, academic papers, reports, presentations, invoices, and CJK documents.
Ships in chanmeng-typst. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are an expert Typst typesetter. Generate professional PDF, PNG, SVG, or HTML documents using Typst. This skill is written for Typst 0.14+ and tested on 0.15.1.
A clean compile is where the work starts to be checked, not where it ends: many layout and text bugs produce no error or warning. Step 4 of the Workflow is what catches them.
Ask, in this order, before writing any .typ:
What is the artefact?
references/ats-resume.md and examples/resume-ats.typreferences/typst-templates.md § 4a Simple or § 4b Typographic Two-ColumnIs the language CJK (Chinese / Japanese / Korean)?
If yes, always layer the CJK font setup from § CJK Document on top of the chosen template — missing this is the #1 source of "tofu" (□) bugs. Then read references/typst-pitfalls.md § CJK text, because system fonts without bold and source line breaks cause problems that no error reports.
Does the user have a JSON / CSV data source?
If yes, generate a .typ that calls #let data = json("path.json") (or csv(...)) and loops over it — do not hardcode values from the data into the template.
Is it dense, page-limited, or read by a machine?
If yes, read references/typst-pitfalls.md before tuning layout.
Will it be maintained or reused?
If yes, set it up as a project with shared tokens and components: references/typst-design-patterns.md § Long-Lived Document Projects.
Use only facts the user gave you in resumes, letters and reports. Where something is missing, ask or leave a visible placeholder, because an invented metric or date is hard to spot once typeset.
| Task | Code / Command |
|---|---|
| Compile to PDF | typst compile doc.typ |
| Compile to PNG | typst compile doc.typ --format png --ppi 300 |
| Compile & open | typst compile doc.typ --open |
| Set page | #set page(paper: "a4", margin: 2.5cm) |
| Set font | #set text(font: "Libertinus Serif", size: 11pt) |
| CJK font | #set text(lang: "zh", font: ("Source Han Serif SC", "Noto Serif CJK SC", "SimSun")) |
| Heading | = Title / == Subtitle / === Sub-subtitle |
| Math | $ integral_0^infinity e^(-x^2) dif x = sqrt(pi) / 2 $ |
| Import package | #import "@preview/cetz:0.5.3": canvas, draw |
| Load data | #let data = json("data.json") or csv("data.csv") |
| Evaluate expression | typst eval "1 + 2" |
| Conditional format | #context if target() == "html" { ... } else { ... } |
| List fonts | typst fonts |
typst --version
For a deeper check (CJK fonts available, write permissions, version ≥ 0.14), run the bundled script from this skill's directory:
bash scripts/verify-typst.sh
If typst is not installed:
winget install --id Typst.Typstbrew install typstcargo install --locked typst-cliTo update an existing install, use winget upgrade --id Typst.Typst, brew upgrade typst, or typst update for a standalone binary.
.typ source filereferences/typst-templates.mdreferences/typst-language-reference.md for syntaxreferences/typst-design-patterns.md.typ file to the user's desired locationtypst compile document.typ # PDF (default)
typst compile document.typ --format png --ppi 300 # High-res PNG
typst compile document.typ output.svg # SVG
See references/typst-cli-reference.md for all options.
Check the exit code, because a failed compile leaves any previous PDF in place. Treat unknown font family as a problem to fix: the fallback font changes line breaks and page count.
Do this before telling the user the document is done.
Look at it. Render the pages and read each image, since spacing, overflow, orphaned lines and wrong icon colours only show on a render:
typst compile document.typ "page-{p}.png" --ppi 150
Check it. Run the bundled checker. It needs poppler, and reports page count, font embedding, text extraction, lost hyphens and bare ~:
python scripts/check-pdf.py document.pdf --source document.typ --pages 2
Pass --pages N when the user gave a page limit, --ats for a job-portal resume, and --require "text" ... for facts that must survive extraction, such as names, dates and contact details. If poppler is missing and cannot be installed, say which checks were skipped.
Read compilation errors, consult the Recovery Recipes below, fix the .typ file, recompile, and repeat Step 4. Re-check the page count after every layout change.
| Mistake | Fix |
|---|---|
| CJK glyphs missing or tofu (□) | Set lang AND provide a CJK font fallback chain: #set text(lang: "zh", font: ("Source Han Serif SC", "SimSun")) |
Chinese *bold* looks like body text | SimSun, SimHei and KaiTi have no bold face. Map strong to a font that does |
| Stray space between Chinese characters | A source line break becomes a space. Keep each paragraph on one line |
| First Chinese paragraph is not indented | Use first-line-indent: (amount: 2em, all: true) |
Windows path errors in #image() / #include() | Use forward slashes: image("images/photo.jpg"). Backslashes are an error since 0.15 |
~85% loses its tilde | ~ is a non-breaking space in markup. Write \~85% |
| Email address breaks the compile | @ starts a reference in markup. Write name\@example.com |
| Gap between blocks ignores your edit | Block margins collapse to the larger one, not the sum. See references/typst-pitfalls.md |
A title sits closer to the next line after adding v() | v() replaces the leading between two lines. Give each line its own block |
SVG icon is black despite text(fill: ...) | image() does not inherit currentColor. Write the colour into the SVG |
web-vitals extracts as webvitals | Box hyphenated compounds: references/typst-pitfalls.md § Line-end hyphens vanish on extraction |
| Font not found | Run typst fonts to list available fonts; bundle custom fonts with --font-path ./fonts |
context errors in Typst v0.14+ | Accessing counter(), state(), or text.fill requires wrapping in a context block |
show rules leaking to other sections | Wrap scoped show rules in a block { ... } to limit their effect |
| Multi-page PNG/SVG produces single file | Use {p} placeholder in output: typst compile doc.typ "page-{p}.png" |
| Package download fails | First compile with a new @preview package requires internet; check --package-cache-path |
| Paragraph spacing looks wrong | Set #set par(justify: true, leading: 0.8em) explicitly; defaults vary |
| Math script styles not working | Use scr(), cal(), frak(), bb() — not LaTeX \mathscr, \mathcal |
typst compile works locally but the PDF is blank from a Vercel / serverless function | The Vercel runtime does not include the Typst CLI. Either ship a static prebuilt binary in the deploy bundle (vercel.json includeFiles) or call a separate compile service (Fly.io / Railway). See references/typst-design-patterns.md § Serverless. |
When typst compile fails, paste stderr's first line into this lookup before guessing:
| stderr starts with | Most likely cause | First thing to try |
|---|---|---|
error: file not found (...) image(...) | wrong relative path | cd to the .typ file's directory; use forward slashes |
error: path must not contain a backslash | Windows-style path | use forward slashes |
error: path ... would escape the project root | file sits outside --root | pass a higher --root, or move the file inside it |
error: label `<...>` does not exist in the document | bare @ in markup, often an email address | escape it as \@, or define the label |
error: expected integer, found string on .at("key") | () is an empty array, not a dictionary | use (:) as the default value |
error: unknown variable: <name> | typo or missing #let <name> | grep the file for the symbol; check that imports use the right alias |
error: failed to load package | offline / firewall blocks @preview | retry with internet; or vendor the package locally and import by path |
error: cannot apply fill to ... (context error) | v0.14 introspection requires context | wrap the access in context { ... } |
error: type mismatch: expected ..., found ... | passed wrong shape from JSON to a function | log the data with #repr(data) once, inspect, then narrow the access |
.tex files--features html but limited)Read these files on demand (not all at once):
| Reference | Path | Content |
|---|---|---|
| CLI Reference | references/typst-cli-reference.md | All CLI commands, options, environment variables |
| Language Reference | references/typst-language-reference.md | Complete syntax, functions, and features |
| Templates | references/typst-templates.md | Ready-to-use templates (general, CJK, academic, resume, letter, report, slides, invoice) |
| Design Patterns | references/typst-design-patterns.md | Advanced patterns (project layout, themes, components, PDF capabilities) |
| Pitfalls | references/typst-pitfalls.md | Bugs the compiler does not report: spacing, lost text, icons, fonts, page budgets |
| ATS Resumes | references/ats-resume.md | Rules, skeleton and verification for resumes read by machines |
| Format | Extension | Notes |
|---|---|---|
.pdf | Default. Supports PDF/A standards and tagged PDF. | |
| PNG | .png | One image per page. Use --ppi for resolution (default 144). |
| SVG | .svg | One file per page. Vector graphics. |
| HTML | .html | Experimental. Use --features html. |
| Bundle | folder | Experimental. Several files from one source: --features bundle --format bundle. |
evals/ats-resume-for-job-portal/case.yaml (opens in a new tab)evals/ats-resume-for-job-portal/graders/01-extracts-hyphenated-terms.md (opens in a new tab)evals/ats-resume-for-job-portal/graders/02-keeps-tilde-and-email.md (opens in a new tab)evals/ats-resume-for-job-portal/graders/03-single-column-no-images.md (opens in a new tab)evals/ats-resume-for-job-portal/graders/04-file-metadata.md (opens in a new tab)evals/ats-resume-for-job-portal/graders/05-no-invented-facts.md (opens in a new tab)evals/ats-resume-for-job-portal/graders/06-verified-before-reporting.md (opens in a new tab)evals/ats-resume-for-job-portal/prompt.md (opens in a new tab)evals/chinese-report-typesetting/case.yaml (opens in a new tab)evals/chinese-report-typesetting/graders/01-bold-is-visible.md (opens in a new tab)evals/chinese-report-typesetting/graders/02-first-paragraph-indented.md (opens in a new tab)evals/chinese-report-typesetting/graders/03-no-stray-spaces.md (opens in a new tab)evals/chinese-report-typesetting/graders/04-chinese-quotes.md (opens in a new tab)evals/chinese-report-typesetting/graders/05-all-content-present.md (opens in a new tab)evals/chinese-report-typesetting/graders/06-numbered-sections.md (opens in a new tab)evals/chinese-report-typesetting/prompt.md (opens in a new tab)evals/designed-cv-two-page-budget/case.yaml (opens in a new tab)evals/designed-cv-two-page-budget/graders/01-exactly-two-pages.md (opens in a new tab)evals/designed-cv-two-page-budget/graders/02-icons-in-accent-colour.md (opens in a new tab)evals/designed-cv-two-page-budget/graders/03-quote-kept-together.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
typst, pdf-generation, typesetting, document-generation, resume-builder
npx claudepluginhub chanmeng666/chanmeng-typst --plugin chanmeng-typstOther plugins' skills for the same job