typst by lucifer1004/claude-skill-typst
npx skills add https://github.com/lucifer1004/claude-skill-typst --skill typst现代化的排版系统 —— 比 LaTeX 更简单,编译更快,可编程。
typst compile document.typ # 编译一次
typst compile document.typ output.pdf # 指定输出路径
typst compile src/main.typ --root . # 为 /path 导入设置项目根目录
typst watch document.typ # 监听文件变化并重新编译
智能体无法预览 PDF。请通过退出代码和 pdftotext 进行验证:
typst compile document.typ && pdftotext document.pdf - | head -20
#set page(paper: "a4", margin: 2cm)
#set text(size: 11pt)
= 标题
内容写在这里。
| 当您需要... | 阅读 |
|---|---|
| 学习语法、导入、函数、控制流 | basics.md |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 学习数据类型、运算符、字符串/数组方法 | types.md |
| 设置页面、标题、图形、布局样式 | styling.md |
| 表格、网格、单元格合并、边框、数据表格 | tables.md |
| 学术论文、参考文献、定理、方程式 | academic.md |
| 从 Markdown 或 LaTeX 转换 | conversion.md |
| 当您需要... | 阅读 |
|---|---|
| 使用状态、上下文、查询或解析 XML | advanced.md |
| 创建可复用的模板函数 | template.md |
| 创建或发布包 | package.md |
| 调试输出(pdftotext, repr, measure) | debug.md |
| 性能分析(--timings, hotspots) | perf.md |
搜索 Typst Universe 包的嵌入式索引(每周更新):
python3 scripts/search-packages.py "what you need"
python3 scripts/search-packages.py "chart" --category visualization
python3 scripts/search-packages.py --category cv --top 5
python3 scripts/search-packages.py --list-categories
#import "@preview/package-name:version": *
#import "@preview/package-name:version": specific-func
| 错误 | 原因 | 修复方法 |
|---|---|---|
| "unknown variable" | 未定义的标识符 | 检查拼写,确保在使用前有 #let |
| "expected X, found Y" | 类型不匹配 | 查阅文档检查函数签名 |
| "file not found" | 错误的导入路径 | 路径相对于当前文件解析 |
| "unknown font" | 字体未安装 | 使用系统字体或 Web 安全字体 |
| "maximum function call depth exceeded" | 深度递归 | 改用迭代 |
| "can only be used when context is known" | 缺少 context 包装器 | 用 context { ... } 包装 |
| "unexpected argument" | 参数使用 = 而不是 : | 命名参数使用 : 语法:func(name: value) |
| "variables from outside are read-only" | 修改了捕获的变量 | 使用循环累加或 state() —— 参见 advanced.md |
| "expected content, found string" (或反之) | 内容/字符串类型不匹配 | 使用 [#str-var] 将字符串嵌入内容 |
| set/show 规则无效 | 规则放置在内容之后 | 将 set/show 规则放在其目标内容之前 |
| 示例 | 描述 |
|---|---|
| basic-document.typ | 包含所有常见元素的完整初学者文档 |
| styled-document.typ | set/show 规则、页面布局、多区域文档 |
| template-report.typ | 带有页眉、计数器和注释框的可复用模板 |
| tables-showcase.typ | 表格功能:合并、条纹、网格、数据生成 |
| academic-paper.typ | 包含定理、方程式和参考文献布局的论文 |
| package-example/ | 带有子模块的最小可发布包 |
brew install typstcargo install typst-cliwinget install typst每周安装次数
272
仓库
GitHub 星标
31
首次出现
2026年1月24日
安全审计
安装于
opencode246
codex241
gemini-cli240
github-copilot228
amp216
kimi-cli212
Modern typesetting system — simpler than LaTeX, faster compilation, programmable.
typst compile document.typ # compile once
typst compile document.typ output.pdf # explicit output path
typst compile src/main.typ --root . # set project root for /path imports
typst watch document.typ # recompile on change
Agents cannot preview PDFs. Verify via exit code and pdftotext:
typst compile document.typ && pdftotext document.pdf - | head -20
#set page(paper: "a4", margin: 2cm)
#set text(size: 11pt)
= Title
Content goes here.
| When you need to... | Read |
|---|---|
| Learn syntax, imports, functions, control flow | basics.md |
| Learn data types, operators, string/array methods | types.md |
| Style pages, headings, figures, layout | styling.md |
| Tables, grids, cell spans, borders, data tables | tables.md |
| Academic papers, bibliography, theorems, equations | academic.md |
| Convert from Markdown or LaTeX | conversion.md |
Start withbasics.md — it covers modes, imports, functions, control flow, and common pitfalls. For data types and operators, see types.md.
| When you need to... | Read |
|---|---|
| Use state, context, query, or parse XML | advanced.md |
| Create a reusable template function | template.md |
| Create or publish a package | package.md |
| Debug output (pdftotext, repr, measure) | debug.md |
| Profile performance (--timings, hotspots) | perf.md |
basics.md and types.md are also the foundation for developers.
Search the embedded index of Typst Universe packages (updated weekly):
python3 scripts/search-packages.py "what you need"
python3 scripts/search-packages.py "chart" --category visualization
python3 scripts/search-packages.py --category cv --top 5
python3 scripts/search-packages.py --list-categories
#import "@preview/package-name:version": *
#import "@preview/package-name:version": specific-func
| Error | Cause | Fix |
|---|---|---|
| "unknown variable" | Undefined identifier | Check spelling, ensure #let before use |
| "expected X, found Y" | Type mismatch | Check function signature in docs |
| "file not found" | Bad import path | Paths resolve relative to current file |
| "unknown font" | Font not installed | Use system fonts or web-safe alternatives |
| "maximum function call depth exceeded" | Deep recursion | Use iteration instead |
| "can only be used when context is known" | Missing context wrapper | Wrap in context { ... } |
| Example | Description |
|---|---|
| basic-document.typ | Complete beginner document with all common elements |
| styled-document.typ | Set/show rules, page layout, multi-region document |
| template-report.typ | Reusable template with headers, counters, note boxes |
| tables-showcase.typ | Table features: spans, stripes, grids, data gen |
| academic-paper.typ | Paper with theorems, equations, bibliography layout |
| package-example/ | Minimal publishable package with submodules |
brew install typstcargo install typst-cliwinget install typstWeekly Installs
272
Repository
GitHub Stars
31
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode246
codex241
gemini-cli240
github-copilot228
amp216
kimi-cli212
内容引擎:AI驱动的内容创作与多平台分发工具,实现高效内容再利用与原生适配
1,200 周安装
| "unexpected argument" | = instead of : for args | Named args use : syntax: func(name: value) |
| "variables from outside are read-only" | Mutating captured variable | Use loop accumulation or state() — see advanced.md |
| "expected content, found string" (or vice versa) | Content/string type mismatch | Use [#str-var] to embed string in content |
| set/show rule has no effect | Rule placed after content | Place set/show rules before the content they target |