Skip to content
cccskills
FreePublished on GitHub

typst-author

Create, edit, and troubleshoot Typst documents, a system for producing formatted documents from text files. Uses bundled documentation to check syntax and styling, with formatting checks and compilation when the required tools are available.

OriginalShow the original description

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.

See how to install

Good for

  • Creating a new Typst document
  • Adjusting page layout, tables, and heading styles
  • Fixing syntax and compilation errors
  • Checking template and package usage

Files included (199)

  • SKILL.md9.0 KB
  • docs/changelog/0.1.0.md3.5 KB
  • docs/changelog/0.10.0.md6.4 KB
  • docs/changelog/0.11.0.md16.9 KB
  • docs/changelog/0.11.1.md2.6 KB
  • docs/changelog/0.12.0.md23.3 KB
  • docs/changelog/0.13.0.md21.0 KB
  • docs/changelog/0.13.1.md956 B
  • docs/changelog/0.14.0.md38.6 KB
  • docs/changelog/0.14.1.md5.2 KB
  • docs/changelog/0.14.2.md1.7 KB
  • docs/changelog/0.2.0.md2.1 KB
  • docs/changelog/0.3.0.md3.5 KB
  • docs/changelog/0.4.0.md5.5 KB
  • docs/changelog/0.5.0.md3.5 KB
  • docs/changelog/0.6.0.md3.1 KB
  • docs/changelog/0.7.0.md7.8 KB
  • docs/changelog/0.8.0.md6.6 KB
  • docs/changelog/0.9.0.md11.0 KB
  • docs/changelog/earlier.md15.7 KB
  • docs/changelog/index.md966 B
  • docs/guides/accessibility.md42.4 KB
  • docs/guides/for-latex-users.md27.4 KB
  • docs/guides/index.md428 B
  • docs/guides/page-setup.md17.5 KB
  • docs/guides/tables.md48.4 KB
  • docs/index.md680 B
  • docs/reference/context.md9.1 KB
  • docs/reference/data-loading/cbor.md2.2 KB
  • docs/reference/data-loading/csv.md1.9 KB
  • docs/reference/data-loading/index.md1.6 KB
  • docs/reference/data-loading/json.md3.1 KB
  • docs/reference/data-loading/read.md827 B
  • docs/reference/data-loading/toml.md3.0 KB
  • docs/reference/data-loading/xml.md1.6 KB
  • docs/reference/data-loading/yaml.md2.9 KB
  • docs/reference/foundations/arguments.md2.2 KB
  • docs/reference/foundations/array.md15.6 KB
  • docs/reference/foundations/assert.md1.9 KB
  • docs/reference/foundations/auto.md420 B
  • docs/reference/foundations/bool.md194 B
  • docs/reference/foundations/bytes.md2.6 KB
  • docs/reference/foundations/calc.md17.9 KB
  • docs/reference/foundations/content.md3.5 KB
  • docs/reference/foundations/datetime.md8.0 KB
  • docs/reference/foundations/decimal.md5.3 KB
  • docs/reference/foundations/dictionary.md4.0 KB
  • docs/reference/foundations/duration.md1.8 KB
  • docs/reference/foundations/eval.md872 B
  • docs/reference/foundations/float.md3.2 KB
  • docs/reference/foundations/function.md5.4 KB
  • docs/reference/foundations/index.md2.9 KB
  • docs/reference/foundations/int.md6.5 KB
  • docs/reference/foundations/label.md1.8 KB
  • docs/reference/foundations/module.md1.1 KB
  • docs/reference/foundations/none.md367 B
  • docs/reference/foundations/panic.md439 B
  • docs/reference/foundations/plugin.md7.6 KB
  • docs/reference/foundations/regex.md1.4 KB
  • docs/reference/foundations/repr.md1.2 KB
  • docs/reference/foundations/selector.md3.8 KB
  • docs/reference/foundations/std.md1.6 KB
  • docs/reference/foundations/str.md10.6 KB
  • docs/reference/foundations/symbol.md1.7 KB
  • docs/reference/foundations/sys.md742 B
  • docs/reference/foundations/target.md1.3 KB
  • docs/reference/foundations/type.md1.9 KB
  • docs/reference/foundations/version.md1.7 KB
  • docs/reference/html/elem.md1.3 KB
  • docs/reference/html/frame.md665 B
  • docs/reference/html/index.md3.3 KB
  • docs/reference/html/typed.md50.9 KB
  • docs/reference/index.md1.1 KB
  • docs/reference/introspection/counter.md9.1 KB
  • docs/reference/introspection/here.md1.3 KB
  • docs/reference/introspection/index.md1.3 KB
  • docs/reference/introspection/locate.md1.1 KB
  • docs/reference/introspection/location.md2.9 KB
  • docs/reference/introspection/metadata.md966 B
  • docs/reference/introspection/query.md4.5 KB
  • docs/reference/introspection/state.md9.8 KB
  • docs/reference/layout/align.md1.8 KB
  • docs/reference/layout/alignment.md1.6 KB
  • docs/reference/layout/angle.md292 B
  • docs/reference/layout/block.md5.2 KB
  • docs/reference/layout/box.md4.5 KB
  • docs/reference/layout/colbreak.md847 B
  • docs/reference/layout/columns.md2.0 KB
  • docs/reference/layout/direction.md1.6 KB
  • docs/reference/layout/fraction.md407 B
  • docs/reference/layout/grid.md25.2 KB
  • docs/reference/layout/h.md2.0 KB
  • docs/reference/layout/hide.md911 B
  • docs/reference/layout/index.md2.5 KB
  • docs/reference/layout/layout.md2.6 KB
  • docs/reference/layout/length.md1.9 KB
  • docs/reference/layout/measure.md1.9 KB
  • docs/reference/layout/move.md1.1 KB
  • docs/reference/layout/pad.md1.3 KB
  • docs/reference/layout/page.md10.3 KB
  • docs/reference/layout/pagebreak.md1.2 KB
  • docs/reference/layout/place.md6.1 KB
  • docs/reference/layout/ratio.md1.4 KB
  • docs/reference/layout/relative.md2.3 KB
  • docs/reference/layout/repeat.md1.2 KB
  • docs/reference/layout/rotate.md1.5 KB
  • docs/reference/layout/scale.md1.6 KB
  • docs/reference/layout/skew.md1.4 KB
  • docs/reference/layout/stack.md1.5 KB
  • docs/reference/layout/v.md1.1 KB
  • docs/reference/math/accent.md1.6 KB
  • docs/reference/math/attach.md2.8 KB
  • docs/reference/math/binom.md386 B
  • docs/reference/math/cancel.md2.4 KB
  • docs/reference/math/cases.md1.1 KB
  • docs/reference/math/class.md870 B
  • docs/reference/math/equation.md3.1 KB
  • docs/reference/math/frac.md1.4 KB
  • docs/reference/math/index.md5.7 KB
  • docs/reference/math/lr.md3.4 KB
  • docs/reference/math/mat.md3.6 KB
  • docs/reference/math/op.md824 B
  • docs/reference/math/primes.md409 B
  • docs/reference/math/roots.md714 B
  • docs/reference/math/sizes.md2.1 KB
  • docs/reference/math/stretch.md830 B
  • docs/reference/math/styles.md921 B
  • docs/reference/math/underover.md4.2 KB
  • docs/reference/math/variants.md2.7 KB
  • docs/reference/math/vec.md1.3 KB
  • docs/reference/model/bibliography.md3.4 KB
  • docs/reference/model/cite.md2.5 KB
  • docs/reference/model/document.md1.9 KB
  • docs/reference/model/emph.md776 B
  • docs/reference/model/enum.md5.5 KB
  • docs/reference/model/figure.md10.8 KB
  • docs/reference/model/footnote.md4.4 KB
  • docs/reference/model/heading.md6.9 KB
  • docs/reference/model/index.md1.8 KB
  • docs/reference/model/link.md4.5 KB
  • docs/reference/model/list.md3.3 KB
  • docs/reference/model/numbering.md3.0 KB
  • docs/reference/model/outline.md10.7 KB
  • docs/reference/model/par.md16.4 KB
  • docs/reference/model/parbreak.md453 B
  • docs/reference/model/quote.md3.3 KB
  • docs/reference/model/ref.md5.3 KB
  • docs/reference/model/strong.md823 B
  • docs/reference/model/table.md20.7 KB
  • docs/reference/model/terms.md3.3 KB
  • docs/reference/model/title.md1.0 KB
  • docs/reference/pdf/artifact.md1.4 KB
  • docs/reference/pdf/attach.md1.6 KB
  • docs/reference/pdf/data-cell.md1.6 KB
  • docs/reference/pdf/header-cell.md2.8 KB
  • docs/reference/pdf/index.md13.3 KB
  • docs/reference/pdf/table-summary.md2.1 KB
  • docs/reference/png.md3.1 KB
  • docs/reference/scripting.md12.8 KB
  • docs/reference/styling.md5.8 KB
  • docs/reference/svg.md2.6 KB
  • docs/reference/symbols/emoji.md38.8 KB
  • docs/reference/symbols/index.md829 B
  • docs/reference/symbols/sym.md35.8 KB
  • docs/reference/syntax.md11.7 KB
  • docs/reference/text/highlight.md2.1 KB
  • docs/reference/text/index.md1.2 KB
  • docs/reference/text/linebreak.md922 B
  • docs/reference/text/lorem.md546 B
  • docs/reference/text/lower.md312 B
  • docs/reference/text/overline.md1.8 KB
  • docs/reference/text/raw.md9.1 KB
  • docs/reference/text/smallcaps.md1.5 KB
  • docs/reference/text/smartquote.md2.3 KB
  • docs/reference/text/strike.md1.7 KB
  • docs/reference/text/sub.md1.9 KB
  • docs/reference/text/super.md2.0 KB
  • docs/reference/text/text.md20.5 KB
  • docs/reference/text/underline.md1.7 KB
  • docs/reference/text/upper.md313 B
  • docs/reference/visualize/circle.md2.2 KB
  • docs/reference/visualize/color.md20.6 KB
  • docs/reference/visualize/curve.md8.4 KB
  • docs/reference/visualize/ellipse.md1.9 KB
  • docs/reference/visualize/gradient.md14.4 KB
  • docs/reference/visualize/image.md6.5 KB
  • docs/reference/visualize/index.md1.9 KB
  • docs/reference/visualize/line.md1.4 KB
  • docs/reference/visualize/path.md2.4 KB
  • docs/reference/visualize/polygon.md2.5 KB
  • docs/reference/visualize/rect.md3.7 KB
  • docs/reference/visualize/square.md2.5 KB
  • docs/reference/visualize/stroke.md4.6 KB
  • docs/reference/visualize/tiling.md3.9 KB
  • docs/tutorial/advanced-styling.md18.9 KB
  • docs/tutorial/formatting.md10.3 KB
  • docs/tutorial/index.md2.1 KB
  • docs/tutorial/making-a-template.md15.2 KB
  • docs/tutorial/writing-in-typst.md12.0 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

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

#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
// 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).
// 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,).

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

_references

FreeSummary

Provides shared reference material for mathematical modeling competitions, covering writing conventions, problem-specific pitfalls, and chart guidelines. Other skills consult relevant sections during their work; this resource does not run independently.

  • Referencing competition writing conventions
  • Checking pitfalls for different problem types
  • Consulting chart and figure guidelines
jihe520/MathModelAgent6.2KUpdated Oct 3, 2026

1start-mathmodel

FreeSummary

Coordinates a mathematical modeling competition project from planning to final checks. It records formatting and language preferences, creates a plan and task checklist, and calls dedicated skills for modeling, coding, diagrams, paper writing, and verification.

  • Starting a mathematical modeling competition project
  • Planning work around competition and formatting preferences
  • Tracking progress across modeling and paper-writing stages
jihe520/MathModelAgent6.2KUpdated Oct 3, 2026

Turns mathematical modeling competition problems and attachments into an implementation-ready report. It breaks down questions, examines ambiguous assumptions and data quality, and defines variables, equations, constraints, solution methods, and validation steps.

  • Breaking down competition questions and their dependencies
  • Comparing interpretations of ambiguous problem statements
  • Reviewing attached data before modeling
jihe520/MathModelAgent6.2KUpdated Oct 3, 2026

3coding-visual

FreeSummary

Implements mathematical models from a design report as reproducible code, runs calculations, and checks results. It records methods and validation findings in a results report and produces data-based PDF charts for papers.

  • Implementing models from a modeling report
  • Checking constraints and evaluating prediction errors
  • Creating PDF charts from computed results
jihe520/MathModelAgent6.2KUpdated Oct 3, 2026

4drawio

FreeSummary

Turn mathematical modeling reports into DrawIO diagrams showing solution steps, model structures, and data processing flows. Produce editable source files, export PDFs for papers when DrawIO is available, and record diagram choices and export results.

  • Illustrate the overall approach in a modeling paper
  • Draw solution flows for individual subproblems
  • Show model structure and variable relationships
jihe520/MathModelAgent6.2KUpdated Oct 3, 2026

5writing

FreeSummary

Write mathematical modeling competition papers from existing analysis reports, results, and figure PDFs. Use competition templates in Typst or LaTeX, tools for document layout, to organize sections, place figures, and prepare references and summaries.

  • Turn modeling reports into a competition paper
  • Use a template for MCM or CUMCM
  • Place existing figures in relevant sections
jihe520/MathModelAgent6.2KUpdated Oct 3, 2026

See all skills by jihe520

Report a problem with this skill