Typst Author logo

Typst Author

CommunityPopular
jihe520
typst-author

Generate idiomatic Typst (.typ) code, edit and troubleshoot Typst documents and projects, and answer Typst syntax/reference questions. Use when working with .typ files or when the user explicitly asks for Typst document creation, editing, debugging, compilation, formatting, template work, or package usage.

Overview

Publisherjihe520
RepositoryMathModelAgent
Skill nametypst-author
Stars
5.6K
Forks
423
Bundled files
198
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 198 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jihe520 on GitHub. Read the source before you install it.

Installation

Install the Typst Author AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jihe520/MathModelAgent.git /tmp/MathModelAgent
mkdir -p .claude/skills
cp -r /tmp/MathModelAgent/skills/typst-author .claude/skills/typst-author
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Typst Author in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Typst Author on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Typst Author is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

typst-author skill

Overview

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).

Minimal document example

typst
#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)

Workflows

  • Creating a new Typst project: Use the "Minimal document example" above as a starting point. Skim the tutorial for the basics (docs/tutorial/writing-in-typst.md), then create the .typ file(s). After each .typ edit, follow the post-edit formatting checks below when typstyle is available.
  • Editing existing content: Locate the target text and apply changes; confirm syntax against the reference when needed (docs/reference/). After each modified .typ file, follow the post-edit formatting checks below.
  • Formatting & Styling: Consult the styling guide (docs/reference/styling.md) for set rule, show rule, and custom themes.

Documentation

  • Syntax & foundations: docs/reference/syntax.md
  • Styling & show/set rules: docs/reference/styling.md
  • Scripting & runtime behavior: docs/reference/scripting.md
  • Page setup & tables: docs/guides/page-setup.md and docs/guides/tables.md
  • Task-oriented authoring help: docs/tutorial/writing-in-typst.md, docs/guides/*.md, and docs/reference/**/*.md

Detailed instructions

  1. PRIORITY: Trust local documentation. Your internal training data regarding Typst may be outdated or hallucinated. Always verify function names, parameters, and syntax against the local docs/ folder before generating code.
  2. Read the relevant documentation using local file search and open tools on the paths above.
  3. Use local docs for syntax and reference questions. Verify syntax, function names, parameters, and reference behavior from the bundled docs. Run a minimal Typst probe only when runtime or evaluation behavior remains unclear after checking the docs.
  4. Generate or modify the .typ source according to the user's request.
  5. Run the post-edit formatting checks below for every .typ file you created or edited in that pass.
  6. Validate with typst compile after the formatting decision is complete when you created or edited .typ files, or when the user explicitly asks for verification (if tool access is allowed).
  7. Summarize touched files and outcomes. Provide full .typ content only when the user requests it or when direct editing is not possible, and optionally include a rendered preview (PDF/HTML).

Probing uncertain behavior

  • Use a probe when the bundled docs do not settle runtime or evaluation behavior.
  • Model the case with Typst scripting as described in docs/reference/scripting.md.
  • When a probe is necessary, prefer a fileless probe through stdin instead of creating scratch .typ files. Expose the value with metadata(...) <probe> and read it with typst query - "<probe>" --field value --one. See docs/reference/introspection/query.md and docs/reference/introspection/metadata.md.
  • Example: printf '#metadata(1 + 2) <probe>\n' | typst query - "<probe>" --field value --one

Post-edit formatting checks

  1. Check whether typstyle is available with command -v typstyle. If it is unavailable, skip the remaining formatting checks.
  2. After each .typ file modification, run typstyle --check <file> for the file you just created or edited.
  3. If typstyle --check fails, inspect the formatter changes with typstyle --diff <file> before deciding what to do.
  4. Apply formatting with typstyle -i <file> only when the formatter changes are limited to a newly created file or to code you created or edited in the current task.
  5. Stop and ask the user when formatting would change untouched pre-existing code. If the diff reaches outside your own edits, or if you cannot confidently prove that every formatter change is limited to your edits, ask instead of formatting.

Quick syntax reference

Critical distinctions

Hash usage (markup vs code)

  • Use # to start a code expression inside markup or content blocks; it disambiguates code from text. This is required for content-producing function calls and field access in markup: #figure[...], #image("file.png"), text(...)[#numbering(...)].
  • Do not use # inside code contexts (argument lists, code blocks, show-rule bodies). Example: #figure(image("file.png")) (no # before image).
  • Reference: docs/reference/scripting.md, docs/tutorial/writing-in-typst.md
typst
// Incorrect (missing # inside content block)
text(...)[(numbering(...))]

// Correct
text(...)[(#numbering(...))]

Styling rules: set vs show

  • set: Set rule to configure optional parameters on element functions (style defaults scoped to the current block or file).
  • show: Show rule to target selected elements and apply a set rule or transform/replace the element output.
  • Use set for common styling; use show for selective or structural changes (e.g., heading.where(level: 1), labels, text, regex).
typst
// Set rule: configure optional parameters for an element type
#set heading(numbering: "I.")
#set text(font: "New Computer Modern")

// Show-set rule: apply a set rule only to selected elements
#show heading: set text(navy)

// Show transform rule: replace/reshape element output
#show heading: it => block[#emph(it.body)]

Common mistakes to avoid

  • Calling things "tuples" (Typst only has arrays).
  • Using [] for arrays (use () instead).
  • Accessing array elements with arr[0] (use arr.at(0)).
  • Omitting # in markup/content blocks (e.g., text(...)[numbering(...)] should be text(...)[#numbering(...)]).
  • Using # inside code contexts (e.g., figure(#image("x.png")) in an argument list).
  • Mixing up content blocks [] with code blocks {}.
  • Forgetting to include the namespace when accessing imported variables/functions (e.g., use color.hsl instead of just hsl).
  • Using LaTeX syntax (do NOT use \begin{...}, \section, or other LaTeX commands).
  • Hallucinating environments (e.g., tabular does not exist; use table).

Advanced features

For large projects

When working on large projects, consider organizing the project across multiple files.

Troubleshooting

Missing font warnings

If 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.

Template/Package not found

If import fails with "package not found":

  • Verify exact package name and version on Typst Universe.
  • Check for typos in @preview/package:version syntax.

Compilation errors

Common fixes:

  • "expected content, found ...": You're using code where markup is expected - wrap in #{ } or use proper syntax.
  • "expected expression, found ...": Missing # (or #(...)) in markup/content blocks.
  • "unknown variable": Check spelling, ensure imports are correct.
  • Array/dictionary errors: Review syntax - use () for both, dictionaries need key: value, singleton arrays are (elem,).

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

and 138 more files.

Frequently asked questions

What does the Typst Author AI skill do?

Generate idiomatic Typst (.typ) code, edit and troubleshoot Typst documents and projects, and answer Typst syntax/reference questions. Use when working with .typ files or when the user explicitly asks for Typst document creation, editing, debugging, compilation, formatting, template work, or package usage.

Why use Typst Author on TypingMind?

Because you install it once and use it with any model. Typst Author is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Typst Author in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jihe520/MathModelAgent/tree/main/skills/typst-author. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Typst Author?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Typst Author?

As many as you like. As long as a model supports skills, you can use Typst Author with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Typst Author AI skill free?

It is published on GitHub by jihe520. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇