typst-authoring
This skill should be used when the user asks to "write Typst", "create a Typst document", "format in Typst", "convert to Typst", "Typst syntax", "Typst template", "Typst math", "Typst table", or works with .typ files. Provides comprehensive Typst markup, scripting, math, layout, and styling reference for authoring documents. Also use proactively when generating .typ output files (e.g., in deep-research reports).
What this skill does
# Typst Authoring Reference
Typst is a modern typesetting language with three syntactic modes: **markup** (default), **code** (`#`), and **math** (`$`). Understanding mode transitions is the core skill for productive authoring.
## Three Modes at a Glance
- **Markup mode** (default) — Text, `*bold*`, `_italic_`, `= Heading`, `- list`, `+ ordered`, `/ term: def`
- **Code mode** (enter with `#`) — Variables, functions, control flow, imports. End with `;` to return to markup.
- **Math mode** (enter with `$`) — `$inline$` (no spaces) or `$ block $` (spaces). Single letters = italic variables; multi-letter = function names.
## Essential Syntax Quick Reference
| Element | Syntax |
| ------------------ | --------------------------------------- |
| Bold / Italic | `*bold*` / `_italic_` |
| Heading | `= H1`, `== H2`, `=== H3` |
| Lists | `- bullet`, `+ numbered`, `/ Term: def` |
| Link | `https://...` or `#link("url")[text]` |
| Label / Reference | `<name>` / `@name` |
| Code expression | `#expr` |
| Line break | `\` |
| Comment | `// line` or `/* block */` |
| Non-breaking space | `~` |
| Dashes | `--` (en), `---` (em) |
| Escape | `\#`, `\@`, `\$`, `\*`, etc. |
## Set Rules and Show Rules
**Set rules** configure defaults for functions:
```typst
#set text(font: "New Computer Modern", size: 11pt)
#set par(justify: true)
#set heading(numbering: "1.")
#set page("a4", margin: (x: 2.5cm, y: 2.5cm))
```
Set rules are scoped to their enclosing content block `[...]`.
**Show rules** transform rendering:
```typst
#show heading: set text(navy) // show-set (composable)
#show heading: it => emph(it.body) // transformational
#show: columns.with(2) // everything rule
#show heading.where(level: 1): set align(center) // filtered
```
Selectors: element functions, `.where(field: val)`, `"text"`, `regex(...)`, `<label>`, or bare `show:` for everything.
Prefer show-set rules over transformational rules for composability.
## Page Layout Essentials
```typst
#set page("a4", margin: (x: 2.5cm, y: 2.5cm), numbering: "1")
#set page(header: [Title #h(1fr) Author], footer: context [
#h(1fr) #counter(page).display("1/1", both: true)
])
#set page(columns: 2) // page-level columns (preferred)
#colbreak() // manual column break
#pagebreak(weak: true) // page break
```
When a custom `footer` is set, the `numbering` parameter is silently ignored — display page numbers manually via `counter(page).display()`.
## Code Mode Essentials
Enter with `#`. Key types: `none`, `auto`, `bool`, `int`, `float`, `str`, `content`, `array`, `dictionary`, `length`, `ratio`, `fraction`, `function`.
Single-element array: `(1,)` (trailing comma required). Empty dict: `(:)`.
```typst
#let x = 42
#if x > 10 [big] else [small]
#for item in items [#item, ]
#let greet(name, excited: false) = [Hello #name#if excited [!]]
```
Functions are pure. Use `.with()` for partial application. Import with `#import "file.typ": item` or `#import "@preview/pkg:version": item`.
## Math Mode Essentials
```typst
$a^2 + b^2 = c^2$ // inline
$ sum_(i=0)^n a_i = integral f(x) dif x $ // block
$ frac(a, b), sqrt(x), root(3, x) $ // fractions, roots
$ mat(1, 2; 3, 4) $ // matrix (semicolons = rows)
$ vec(a, b, c) $ // vector
$ cases(1 "if" x > 0, 0 "else") $ // cases
```
Greek: `alpha`, `beta`, `gamma`, `pi`, etc. Blackboard bold: `NN`, `ZZ`, `RR`, `CC`. Accents: `hat(x)`, `dot(x)`, `tilde(x)`, `arrow(x)`. Styles: `bold(A)`, `cal(A)`, `bb(N)`, `frak(P)`.
Equation numbering: `#set math.equation(numbering: "(1)")`. Reference with `$ ... $ <label>` and `@label`.
## Tables Quick Reference
```typst
#table(
columns: (1fr, auto, auto),
table.header([*Name*], [*Age*], [*City*]),
[Alice], [30], [NYC],
[Bob], [25], [LA],
)
```
Key features: `table.cell(colspan: 2)`, `table.cell(rowspan: 3)`, `table.hline()`, `table.vline()`. Alignment/fill/stroke accept arrays (cycle per column) or `(x, y) =>` functions. Use `table` for data (accessible), `grid` for layout.
## Figures and Bibliography
```typst
#figure(image("photo.jpg", width: 80%), caption: [A photo.]) <fig>
@fig shows the photo.
#bibliography("refs.bib", style: "ieee")
@key, @key[p.~7], #cite(<key>, form: "prose")
#footnote[Note text]
```
## Key Gotchas
1. **Fraction parens consumed:** `(a+b)/c` removes the parens. Double them: `((a+b))/c`.
2. **`context` required for introspection:** `counter.get()`, `state.get()`, `query()`, `measure()`, `here()`.
3. **Counter starts at zero:** Step before display. `step()`/`update()` return content that must be placed.
4. **Custom footer kills numbering:** Set `footer:` means `numbering:` is ignored.
5. **Show rules bypass defaults:** Transformational show rules lose numbering, spacing, block behavior.
6. **Math multi-letter:** `area` in math = function name. Use `"area"` for text.
7. **`#` in math:** Access code variables with `#`: `$ #x < 17 $`.
## Additional Resources
### Reference Files
For detailed syntax, patterns, and examples, consult:
- **`references/markup-and-layout.md`** — Full markup syntax table, headings, lists, labels, references, escaping, page setup, margins, headers/footers, columns, spacing, alignment, block/box
- **`references/scripting.md`** — Code mode, types, let bindings, destructuring, control flow, functions, closures, argument sinks, operators, methods, imports, modules
- **`references/math.md`** — Math mode, symbols, Greek letters, subscripts/superscripts, fractions, roots, matrices, vectors, alignment, equation numbering, delimiters, cases, accents, font styles, custom operators
- **`references/tables-figures-bibliography.md`** — Tables (columns, headers, cell spans, alignment, fill, stroke, grid vs table), figures, images, captions, floating figures, bibliography, citations, footnotes
- **`references/advanced.md`** — Custom functions, templates, counters, state, query, context keyword, numbering patterns, metadata, measure, packages
- **`references/visualizations.md`** — Visualization packages: diagrams (fletcher, CeTZ, diagraph, pintorita), charts (lilaq), timelines (timeliney), callout boxes (gentle-clues). Design principles for reader-friendly documents
### Typst Document Template
Standard document setup for reports and research output:
```typst
#set page(margin: (x: 2.5cm, y: 2.5cm), numbering: "1")
#set text(font: "New Computer Modern", size: 11pt)
#set par(justify: true, leading: 0.65em)
#set heading(numbering: "1.1")
#show link: it => text(fill: rgb("#2563eb"), it)
```
### Special Character Escaping in Typst Content
Characters requiring `\` escape in content text: `#`, `@`, `$`, `<`, `>`. When converting Markdown to Typst, escape these in body text but not inside code blocks.
### Markdown-to-Typst Conversion
| Markdown | Typst |
| ------------- | ----------------------------------- |
| `# Heading` | `= Heading` |
| `**bold**` | `*bold*` |
| `*italic*` | `_italic_` |
| `1. item` | `+ item` |
| `[text](url)` | `#link("url")[text]` |
| `> quote` | `#blockquote[text]` (custom helper) |
| `[1]` refs | `#super[1]` |
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.