@vetala/vetala 0.1.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @vetala/vetala might be problematic. Click here for more details.
- package/CONTRIBUTING.md +77 -0
- package/LICENSE +184 -0
- package/README.md +136 -0
- package/THIRD_PARTY_LICENSES.md +17 -0
- package/dist/src/agent.d.ts +30 -0
- package/dist/src/agent.js +216 -0
- package/dist/src/agent.js.map +1 -0
- package/dist/src/approvals.d.ts +18 -0
- package/dist/src/approvals.js +81 -0
- package/dist/src/approvals.js.map +1 -0
- package/dist/src/cli.d.ts +2 -0
- package/dist/src/cli.js +87 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/config.d.ts +12 -0
- package/dist/src/config.js +183 -0
- package/dist/src/config.js.map +1 -0
- package/dist/src/context-memory.d.ts +7 -0
- package/dist/src/context-memory.js +96 -0
- package/dist/src/context-memory.js.map +1 -0
- package/dist/src/ink/command-suggestions.d.ts +7 -0
- package/dist/src/ink/command-suggestions.js +179 -0
- package/dist/src/ink/command-suggestions.js.map +1 -0
- package/dist/src/ink/ink-terminal-ui.d.ts +36 -0
- package/dist/src/ink/ink-terminal-ui.js +79 -0
- package/dist/src/ink/ink-terminal-ui.js.map +1 -0
- package/dist/src/ink/repl-app.d.ts +9 -0
- package/dist/src/ink/repl-app.js +789 -0
- package/dist/src/ink/repl-app.js.map +1 -0
- package/dist/src/ink/transcript-cards.d.ts +6 -0
- package/dist/src/ink/transcript-cards.js +24 -0
- package/dist/src/ink/transcript-cards.js.map +1 -0
- package/dist/src/path-policy.d.ts +11 -0
- package/dist/src/path-policy.js +67 -0
- package/dist/src/path-policy.js.map +1 -0
- package/dist/src/process-utils.d.ts +13 -0
- package/dist/src/process-utils.js +52 -0
- package/dist/src/process-utils.js.map +1 -0
- package/dist/src/repl.d.ts +9 -0
- package/dist/src/repl.js +13 -0
- package/dist/src/repl.js.map +1 -0
- package/dist/src/sarvam/client.d.ts +15 -0
- package/dist/src/sarvam/client.js +208 -0
- package/dist/src/sarvam/client.js.map +1 -0
- package/dist/src/sarvam/models.d.ts +2 -0
- package/dist/src/sarvam/models.js +7 -0
- package/dist/src/sarvam/models.js.map +1 -0
- package/dist/src/search-provider.d.ts +6 -0
- package/dist/src/search-provider.js +8 -0
- package/dist/src/search-provider.js.map +1 -0
- package/dist/src/session-store.d.ts +19 -0
- package/dist/src/session-store.js +318 -0
- package/dist/src/session-store.js.map +1 -0
- package/dist/src/skills/runtime.d.ts +26 -0
- package/dist/src/skills/runtime.js +317 -0
- package/dist/src/skills/runtime.js.map +1 -0
- package/dist/src/skills/types.d.ts +25 -0
- package/dist/src/skills/types.js +2 -0
- package/dist/src/skills/types.js.map +1 -0
- package/dist/src/terminal-ui.d.ts +29 -0
- package/dist/src/terminal-ui.js +236 -0
- package/dist/src/terminal-ui.js.map +1 -0
- package/dist/src/tools/filesystem.d.ts +2 -0
- package/dist/src/tools/filesystem.js +622 -0
- package/dist/src/tools/filesystem.js.map +1 -0
- package/dist/src/tools/git.d.ts +2 -0
- package/dist/src/tools/git.js +326 -0
- package/dist/src/tools/git.js.map +1 -0
- package/dist/src/tools/index.d.ts +6 -0
- package/dist/src/tools/index.js +21 -0
- package/dist/src/tools/index.js.map +1 -0
- package/dist/src/tools/registry.d.ts +15 -0
- package/dist/src/tools/registry.js +59 -0
- package/dist/src/tools/registry.js.map +1 -0
- package/dist/src/tools/shell.d.ts +2 -0
- package/dist/src/tools/shell.js +97 -0
- package/dist/src/tools/shell.js.map +1 -0
- package/dist/src/tools/skill.d.ts +3 -0
- package/dist/src/tools/skill.js +130 -0
- package/dist/src/tools/skill.js.map +1 -0
- package/dist/src/tools/web.d.ts +3 -0
- package/dist/src/tools/web.js +144 -0
- package/dist/src/tools/web.js.map +1 -0
- package/dist/src/types.d.ts +236 -0
- package/dist/src/types.js +2 -0
- package/dist/src/types.js.map +1 -0
- package/dist/src/workspace-trust.d.ts +3 -0
- package/dist/src/workspace-trust.js +31 -0
- package/dist/src/workspace-trust.js.map +1 -0
- package/dist/src/xdg.d.ts +9 -0
- package/dist/src/xdg.js +77 -0
- package/dist/src/xdg.js.map +1 -0
- package/package.json +57 -0
- package/skill/agents-md-generator/SKILL.md +75 -0
- package/skill/agents-md-generator/references/agents_md_template.md +160 -0
- package/skill/agents-md-generator/references/loc_measurement.md +67 -0
- package/skill/agents-md-generator/references/monorepo_detection.md +78 -0
- package/skill/agents-md-generator/references/monorepo_strategy.md +60 -0
- package/skill/agents-md-generator/references/read_only_commands.md +151 -0
- package/skill/agents-md-generator/references/update_strategy.md +160 -0
- package/skill/agents-md-generator/references/working_agreements.md +53 -0
- package/skill/biz-opportunity-scout/SKILL.md +53 -0
- package/skill/biz-opportunity-scout/references/competitive_analysis.md +84 -0
- package/skill/biz-opportunity-scout/references/market_sizing.md +68 -0
- package/skill/biz-opportunity-scout/references/pmf_indicators.md +94 -0
- package/skill/biz-opportunity-scout/references/report_template.md +243 -0
- package/skill/biz-opportunity-scout/references/unit_economics.md +97 -0
- package/skill/code-review/SKILL.md +86 -0
- package/skill/code-review/references/change_analysis.md +116 -0
- package/skill/code-review/references/git_operations.md +115 -0
- package/skill/code-review/references/impact_detection.md +149 -0
- package/skill/code-review/references/output_format.md +137 -0
- package/skill/code-review/references/severity_criteria.md +100 -0
- package/skill/code-security-audit/SKILL.md +123 -0
- package/skill/code-security-audit/references/audit_process.md +277 -0
- package/skill/code-security-audit/references/remediation_patterns.md +599 -0
- package/skill/code-security-audit/references/report_format.md +391 -0
- package/skill/code-security-audit/references/security_domains.md +830 -0
- package/skill/code-security-audit/references/vulnerability_patterns.md +813 -0
- package/skill/composition-patterns/SKILL.md +83 -0
- package/skill/composition-patterns/rules/architecture-avoid-boolean-props.md +100 -0
- package/skill/composition-patterns/rules/architecture-compound-components.md +112 -0
- package/skill/composition-patterns/rules/patterns-children-over-render-props.md +87 -0
- package/skill/composition-patterns/rules/patterns-explicit-variants.md +100 -0
- package/skill/composition-patterns/rules/react19-no-forwardref.md +42 -0
- package/skill/composition-patterns/rules/state-context-interface.md +191 -0
- package/skill/composition-patterns/rules/state-decouple-implementation.md +113 -0
- package/skill/composition-patterns/rules/state-lift-state.md +125 -0
- package/skill/deploy-to-vercel/SKILL.md +293 -0
- package/skill/deploy-to-vercel/resources/deploy-sandbox.sh +301 -0
- package/skill/deploy-to-vercel/resources/deploy.sh +301 -0
- package/skill/doc/SKILL_GUIDELINES.md +138 -0
- package/skill/git-workflow/SKILL.md +94 -0
- package/skill/git-workflow/references/advanced-git.md +632 -0
- package/skill/git-workflow/references/branching-strategies.md +344 -0
- package/skill/git-workflow/references/ci-cd-integration.md +683 -0
- package/skill/git-workflow/references/code-quality-tools.md +351 -0
- package/skill/git-workflow/references/commit-conventions.md +439 -0
- package/skill/git-workflow/references/github-releases.md +288 -0
- package/skill/git-workflow/references/pull-request-workflow.md +773 -0
- package/skill/git-workflow/scripts/verify-git-workflow.sh +263 -0
- package/skill/jetbrains-vmoptions/SKILL.md +51 -0
- package/skill/jetbrains-vmoptions/references/common-options.md +357 -0
- package/skill/jetbrains-vmoptions/references/gc-options.md +350 -0
- package/skill/jetbrains-vmoptions/references/memory-options.md +339 -0
- package/skill/jetbrains-vmoptions/references/prerequisite-check.md +65 -0
- package/skill/kysely-converter/SKILL.md +62 -0
- package/skill/kysely-converter/references/delete.md +323 -0
- package/skill/kysely-converter/references/insert.md +386 -0
- package/skill/kysely-converter/references/operators.md +331 -0
- package/skill/kysely-converter/references/select.md +1000 -0
- package/skill/kysely-converter/references/update.md +349 -0
- package/skill/kysely-converter/references/window_function.md +537 -0
- package/skill/react-best-practices/SKILL.md +131 -0
- package/skill/react-best-practices/rules/advanced-event-handler-refs.md +55 -0
- package/skill/react-best-practices/rules/advanced-init-once.md +42 -0
- package/skill/react-best-practices/rules/advanced-use-latest.md +39 -0
- package/skill/react-best-practices/rules/async-api-routes.md +38 -0
- package/skill/react-best-practices/rules/async-defer-await.md +80 -0
- package/skill/react-best-practices/rules/async-dependencies.md +51 -0
- package/skill/react-best-practices/rules/async-parallel.md +28 -0
- package/skill/react-best-practices/rules/async-suspense-boundaries.md +99 -0
- package/skill/react-best-practices/rules/bundle-barrel-imports.md +59 -0
- package/skill/react-best-practices/rules/bundle-conditional.md +31 -0
- package/skill/react-best-practices/rules/bundle-defer-third-party.md +49 -0
- package/skill/react-best-practices/rules/bundle-dynamic-imports.md +35 -0
- package/skill/react-best-practices/rules/bundle-preload.md +50 -0
- package/skill/react-best-practices/rules/client-event-listeners.md +74 -0
- package/skill/react-best-practices/rules/client-localstorage-schema.md +71 -0
- package/skill/react-best-practices/rules/client-passive-event-listeners.md +48 -0
- package/skill/react-best-practices/rules/client-swr-dedup.md +56 -0
- package/skill/react-best-practices/rules/js-batch-dom-css.md +107 -0
- package/skill/react-best-practices/rules/js-cache-function-results.md +80 -0
- package/skill/react-best-practices/rules/js-cache-property-access.md +28 -0
- package/skill/react-best-practices/rules/js-cache-storage.md +70 -0
- package/skill/react-best-practices/rules/js-combine-iterations.md +32 -0
- package/skill/react-best-practices/rules/js-early-exit.md +50 -0
- package/skill/react-best-practices/rules/js-hoist-regexp.md +45 -0
- package/skill/react-best-practices/rules/js-index-maps.md +37 -0
- package/skill/react-best-practices/rules/js-length-check-first.md +49 -0
- package/skill/react-best-practices/rules/js-min-max-loop.md +82 -0
- package/skill/react-best-practices/rules/js-set-map-lookups.md +24 -0
- package/skill/react-best-practices/rules/js-tosorted-immutable.md +57 -0
- package/skill/react-best-practices/rules/rendering-activity.md +26 -0
- package/skill/react-best-practices/rules/rendering-animate-svg-wrapper.md +47 -0
- package/skill/react-best-practices/rules/rendering-conditional-render.md +40 -0
- package/skill/react-best-practices/rules/rendering-content-visibility.md +38 -0
- package/skill/react-best-practices/rules/rendering-hoist-jsx.md +46 -0
- package/skill/react-best-practices/rules/rendering-hydration-no-flicker.md +82 -0
- package/skill/react-best-practices/rules/rendering-hydration-suppress-warning.md +30 -0
- package/skill/react-best-practices/rules/rendering-svg-precision.md +28 -0
- package/skill/react-best-practices/rules/rendering-usetransition-loading.md +75 -0
- package/skill/react-best-practices/rules/rerender-defer-reads.md +39 -0
- package/skill/react-best-practices/rules/rerender-dependencies.md +45 -0
- package/skill/react-best-practices/rules/rerender-derived-state-no-effect.md +40 -0
- package/skill/react-best-practices/rules/rerender-derived-state.md +29 -0
- package/skill/react-best-practices/rules/rerender-functional-setstate.md +74 -0
- package/skill/react-best-practices/rules/rerender-lazy-state-init.md +58 -0
- package/skill/react-best-practices/rules/rerender-memo-with-default-value.md +38 -0
- package/skill/react-best-practices/rules/rerender-memo.md +44 -0
- package/skill/react-best-practices/rules/rerender-move-effect-to-event.md +45 -0
- package/skill/react-best-practices/rules/rerender-simple-expression-in-memo.md +35 -0
- package/skill/react-best-practices/rules/rerender-transitions.md +40 -0
- package/skill/react-best-practices/rules/rerender-use-ref-transient-values.md +73 -0
- package/skill/react-best-practices/rules/server-after-nonblocking.md +73 -0
- package/skill/react-best-practices/rules/server-auth-actions.md +96 -0
- package/skill/react-best-practices/rules/server-cache-lru.md +41 -0
- package/skill/react-best-practices/rules/server-cache-react.md +76 -0
- package/skill/react-best-practices/rules/server-dedup-props.md +65 -0
- package/skill/react-best-practices/rules/server-hoist-static-io.md +142 -0
- package/skill/react-best-practices/rules/server-parallel-fetching.md +83 -0
- package/skill/react-best-practices/rules/server-serialization.md +38 -0
- package/skill/react-native-skills/SKILL.md +115 -0
- package/skill/react-native-skills/rules/animation-derived-value.md +53 -0
- package/skill/react-native-skills/rules/animation-gesture-detector-press.md +95 -0
- package/skill/react-native-skills/rules/animation-gpu-properties.md +65 -0
- package/skill/react-native-skills/rules/design-system-compound-components.md +66 -0
- package/skill/react-native-skills/rules/fonts-config-plugin.md +71 -0
- package/skill/react-native-skills/rules/imports-design-system-folder.md +68 -0
- package/skill/react-native-skills/rules/js-hoist-intl.md +61 -0
- package/skill/react-native-skills/rules/list-performance-callbacks.md +44 -0
- package/skill/react-native-skills/rules/list-performance-function-references.md +132 -0
- package/skill/react-native-skills/rules/list-performance-images.md +53 -0
- package/skill/react-native-skills/rules/list-performance-inline-objects.md +97 -0
- package/skill/react-native-skills/rules/list-performance-item-expensive.md +94 -0
- package/skill/react-native-skills/rules/list-performance-item-memo.md +82 -0
- package/skill/react-native-skills/rules/list-performance-item-types.md +104 -0
- package/skill/react-native-skills/rules/list-performance-virtualize.md +67 -0
- package/skill/react-native-skills/rules/monorepo-native-deps-in-app.md +46 -0
- package/skill/react-native-skills/rules/monorepo-single-dependency-versions.md +63 -0
- package/skill/react-native-skills/rules/navigation-native-navigators.md +188 -0
- package/skill/react-native-skills/rules/react-compiler-destructure-functions.md +50 -0
- package/skill/react-native-skills/rules/react-compiler-reanimated-shared-values.md +48 -0
- package/skill/react-native-skills/rules/react-state-dispatcher.md +91 -0
- package/skill/react-native-skills/rules/react-state-fallback.md +56 -0
- package/skill/react-native-skills/rules/react-state-minimize.md +65 -0
- package/skill/react-native-skills/rules/rendering-no-falsy-and.md +74 -0
- package/skill/react-native-skills/rules/rendering-text-in-text-component.md +36 -0
- package/skill/react-native-skills/rules/scroll-position-no-state.md +82 -0
- package/skill/react-native-skills/rules/state-ground-truth.md +80 -0
- package/skill/react-native-skills/rules/ui-expo-image.md +66 -0
- package/skill/react-native-skills/rules/ui-image-gallery.md +104 -0
- package/skill/react-native-skills/rules/ui-measure-views.md +78 -0
- package/skill/react-native-skills/rules/ui-menus.md +174 -0
- package/skill/react-native-skills/rules/ui-native-modals.md +77 -0
- package/skill/react-native-skills/rules/ui-pressable.md +61 -0
- package/skill/react-native-skills/rules/ui-safe-area-scroll.md +65 -0
- package/skill/react-native-skills/rules/ui-scrollview-content-inset.md +45 -0
- package/skill/react-native-skills/rules/ui-styling.md +87 -0
- package/skill/react-vite-guide/SKILL.md +101 -0
- package/skill/react-vite-guide/references/composition-patterns.md +709 -0
- package/skill/react-vite-guide/references/performance-optimization.md +1222 -0
- package/skill/react-vite-guide/references/vite-specific.md +385 -0
- package/skill/react-vite-guide/references/web-interface.md +146 -0
- package/skill/skill-maker/SKILL.md +52 -0
- package/skill/skill-maker/references/content_spec.md +67 -0
- package/skill/skill-maker/references/frontmatter_spec.md +96 -0
- package/skill/skill-maker/references/input_validation.md +90 -0
- package/skill/skill-maker/references/skill_structure.md +74 -0
- package/skill/system-prompt-creator/SKILL.md +50 -0
- package/skill/system-prompt-creator/references/data_format_selection.md +135 -0
- package/skill/system-prompt-creator/references/multi_prompt_architecture.md +386 -0
- package/skill/system-prompt-creator/references/prompt_structure.md +140 -0
- package/skill/system-prompt-creator/references/quality_criteria.md +83 -0
- package/skill/typst-creator/SKILL.md +51 -0
- package/skill/typst-creator/references/layout.md +401 -0
- package/skill/typst-creator/references/math.md +297 -0
- package/skill/typst-creator/references/scripting.md +237 -0
- package/skill/typst-creator/references/styling.md +217 -0
- package/skill/typst-creator/references/syntax.md +234 -0
- package/skill/web-design-guidelines/SKILL.md +35 -0
- package/terminal.png +0 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
# Typst Layout Reference
|
|
2
|
+
|
|
3
|
+
Page setup, positioning, and layout elements.
|
|
4
|
+
|
|
5
|
+
## Function Parameters
|
|
6
|
+
|
|
7
|
+
These functions control document structure, positioning, and visual layout. They are the foundation for page design and content arrangement.
|
|
8
|
+
|
|
9
|
+
### `page` Function
|
|
10
|
+
|
|
11
|
+
Configures page dimensions, margins, headers, footers, and numbering. This is typically one of the first set rules in a document.
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Default | Description |
|
|
14
|
+
|-----------|------|---------|-------------|
|
|
15
|
+
| `paper` | str | `"a4"` | `"a4"`, `"us-letter"`, `"a5"`, `"a3"`, etc. |
|
|
16
|
+
| `width` | auto \| length | `auto` | Custom page width |
|
|
17
|
+
| `height` | auto \| length | `auto` | Custom page height |
|
|
18
|
+
| `margin` | auto \| relative \| dict | `auto` | Margins: single value, `(x:, y:)`, or `(top:, bottom:, left:, right:)` |
|
|
19
|
+
| `columns` | int | `1` | Number of columns |
|
|
20
|
+
| `fill` | none \| color | `none` | Background color |
|
|
21
|
+
| `numbering` | none \| str \| func | `none` | Page number format: `"1"`, `"i"`, `"1 / 1"` |
|
|
22
|
+
| `number-align` | alignment | `center + bottom` | Page number alignment |
|
|
23
|
+
| `header` | none \| auto \| content | `auto` | Header content |
|
|
24
|
+
| `header-ascent` | relative | `30%` | Header distance from top |
|
|
25
|
+
| `footer` | none \| auto \| content | `auto` | Footer content |
|
|
26
|
+
| `footer-descent` | relative | `30%` | Footer distance from bottom |
|
|
27
|
+
| `background` | none \| content | `none` | Background content |
|
|
28
|
+
| `foreground` | none \| content | `none` | Foreground overlay |
|
|
29
|
+
| `body` | content | required | Page content |
|
|
30
|
+
|
|
31
|
+
### `grid` Function
|
|
32
|
+
|
|
33
|
+
Creates flexible multi-column/row layouts. Unlike tables, grids have no default styling—use them for pure layout without visual borders.
|
|
34
|
+
|
|
35
|
+
| Parameter | Type | Default | Description |
|
|
36
|
+
|-----------|------|---------|-------------|
|
|
37
|
+
| `columns` | auto \| int \| array | `()` | Column widths: `3`, `(1fr, 2fr)`, `(auto, 1fr)` |
|
|
38
|
+
| `rows` | auto \| int \| array | `()` | Row heights |
|
|
39
|
+
| `gutter` | auto \| length \| array | `0pt` | Gap between cells |
|
|
40
|
+
| `column-gutter` | auto \| length \| array | `auto` | Column gap |
|
|
41
|
+
| `row-gutter` | auto \| length \| array | `auto` | Row gap |
|
|
42
|
+
| `fill` | none \| color \| func | `none` | Cell fill: `(x, y) => color` |
|
|
43
|
+
| `align` | auto \| alignment \| func | `auto` | Cell alignment |
|
|
44
|
+
| `stroke` | none \| stroke | `none` | Cell borders |
|
|
45
|
+
| `inset` | relative \| dict | `0pt` | Cell padding |
|
|
46
|
+
| `children` | content | required | Grid cells |
|
|
47
|
+
|
|
48
|
+
### `table` Function
|
|
49
|
+
|
|
50
|
+
Creates data tables with automatic borders and styling. Tables are semantic containers for tabular data with built-in visual formatting.
|
|
51
|
+
|
|
52
|
+
| Parameter | Type | Default | Description |
|
|
53
|
+
|-----------|------|---------|-------------|
|
|
54
|
+
| `columns` | auto \| int \| array | `()` | Column widths |
|
|
55
|
+
| `rows` | auto \| int \| array | `()` | Row heights |
|
|
56
|
+
| `gutter` | auto \| length \| array | `0pt` | Gap between cells |
|
|
57
|
+
| `fill` | none \| color \| func | `none` | Cell fill: `(x, y) => color` |
|
|
58
|
+
| `align` | auto \| alignment \| func | `auto` | Cell alignment |
|
|
59
|
+
| `stroke` | none \| stroke | `1pt + black` | Cell borders |
|
|
60
|
+
| `inset` | relative \| dict | `5pt` | Cell padding |
|
|
61
|
+
| `children` | content | required | Table cells |
|
|
62
|
+
|
|
63
|
+
**`table.cell` Parameters:**
|
|
64
|
+
|
|
65
|
+
Use `table.cell` for fine control over individual cells, including spanning multiple rows or columns.
|
|
66
|
+
|
|
67
|
+
| Parameter | Type | Default | Description |
|
|
68
|
+
|-----------|------|---------|-------------|
|
|
69
|
+
| `colspan` | int | `1` | Columns to span |
|
|
70
|
+
| `rowspan` | int | `1` | Rows to span |
|
|
71
|
+
| `fill` | auto \| none \| color | `auto` | Cell fill |
|
|
72
|
+
| `align` | auto \| alignment | `auto` | Cell alignment |
|
|
73
|
+
| `body` | content | required | Cell content |
|
|
74
|
+
|
|
75
|
+
### `figure` Function
|
|
76
|
+
|
|
77
|
+
Wraps content (images, tables, code) with automatic numbering and captions. Figures can be referenced and appear in lists of figures.
|
|
78
|
+
|
|
79
|
+
| Parameter | Type | Default | Description |
|
|
80
|
+
|-----------|------|---------|-------------|
|
|
81
|
+
| `body` | content | required | Figure content |
|
|
82
|
+
| `caption` | none \| content | `none` | Caption text |
|
|
83
|
+
| `kind` | auto \| str \| func | `auto` | Figure type: `"image"`, `"table"`, `"raw"` |
|
|
84
|
+
| `supplement` | auto \| none \| content | `auto` | Reference prefix: `"Figure"`, `"Table"` |
|
|
85
|
+
| `numbering` | none \| str \| func | `"1"` | Figure number format |
|
|
86
|
+
| `gap` | length | `0.65em` | Gap between body and caption |
|
|
87
|
+
| `placement` | none \| auto \| alignment | `none` | Float placement: `auto`, `top`, `bottom` |
|
|
88
|
+
|
|
89
|
+
### `image` Function
|
|
90
|
+
|
|
91
|
+
Embeds external images in the document. Supports PNG, JPG, GIF, and SVG formats with automatic or manual sizing.
|
|
92
|
+
|
|
93
|
+
| Parameter | Type | Default | Description |
|
|
94
|
+
|-----------|------|---------|-------------|
|
|
95
|
+
| `path` | str | required | Image file path |
|
|
96
|
+
| `format` | auto \| str | `auto` | `"png"`, `"jpg"`, `"gif"`, `"svg"` |
|
|
97
|
+
| `width` | auto \| relative | `auto` | Image width |
|
|
98
|
+
| `height` | auto \| relative | `auto` | Image height |
|
|
99
|
+
| `alt` | none \| str | `none` | Alt text for accessibility |
|
|
100
|
+
| `fit` | str | `"cover"` | `"cover"`, `"contain"`, `"stretch"` |
|
|
101
|
+
|
|
102
|
+
## Page Setup
|
|
103
|
+
|
|
104
|
+
Page configuration is typically done once at the document start. These settings affect all subsequent pages unless overridden.
|
|
105
|
+
|
|
106
|
+
### Basic Page Configuration
|
|
107
|
+
|
|
108
|
+
Set paper size and margins. Use dictionary syntax for asymmetric margins.
|
|
109
|
+
|
|
110
|
+
```typst
|
|
111
|
+
#set page(
|
|
112
|
+
paper: "a4", // or "us-letter", "a5", etc.
|
|
113
|
+
margin: 2cm, // uniform margin
|
|
114
|
+
margin: (x: 2cm, y: 3cm), // horizontal/vertical
|
|
115
|
+
margin: (top: 3cm, bottom: 2cm, left: 2.5cm, right: 2.5cm),
|
|
116
|
+
)
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Page Numbering
|
|
120
|
+
|
|
121
|
+
Automatic page numbers with customizable format. Use `"1"` for arabic, `"i"` for roman numerals, or combine with total count.
|
|
122
|
+
|
|
123
|
+
```typst
|
|
124
|
+
#set page(numbering: "1") // 1, 2, 3...
|
|
125
|
+
#set page(numbering: "1 / 1") // 1 / 10
|
|
126
|
+
#set page(numbering: "i") // i, ii, iii...
|
|
127
|
+
#set page(number-align: center) // alignment
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Header and Footer
|
|
131
|
+
|
|
132
|
+
Headers and footers accept arbitrary content. Use `context` to access the current page number and other document state.
|
|
133
|
+
|
|
134
|
+
```typst
|
|
135
|
+
#set page(
|
|
136
|
+
header: [
|
|
137
|
+
#set text(8pt)
|
|
138
|
+
Document Title
|
|
139
|
+
#h(1fr)
|
|
140
|
+
#context counter(page).display()
|
|
141
|
+
],
|
|
142
|
+
footer: [
|
|
143
|
+
#set align(center)
|
|
144
|
+
#set text(8pt)
|
|
145
|
+
Page #context counter(page).display()
|
|
146
|
+
],
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
### Background and Foreground
|
|
151
|
+
|
|
152
|
+
Add watermarks, decorations, or overlays. Background renders behind content; foreground renders on top.
|
|
153
|
+
|
|
154
|
+
```typst
|
|
155
|
+
#set page(
|
|
156
|
+
background: place(center + horizon,
|
|
157
|
+
text(60pt, fill: luma(230))[DRAFT]
|
|
158
|
+
),
|
|
159
|
+
)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Spacing
|
|
163
|
+
|
|
164
|
+
Control whitespace between elements. The `fr` unit is particularly powerful for flexible layouts.
|
|
165
|
+
|
|
166
|
+
### Horizontal Spacing
|
|
167
|
+
|
|
168
|
+
Use `h()` for horizontal gaps. The `fr` (fraction) unit distributes remaining space proportionally.
|
|
169
|
+
|
|
170
|
+
```typst
|
|
171
|
+
#h(1cm) // fixed space
|
|
172
|
+
#h(1fr) // flexible space (fills remaining)
|
|
173
|
+
#h(2fr) // twice as much flexible space
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Vertical Spacing
|
|
177
|
+
|
|
178
|
+
Use `v()` for vertical gaps between block elements. Works the same as horizontal spacing.
|
|
179
|
+
|
|
180
|
+
```typst
|
|
181
|
+
#v(1cm) // fixed vertical space
|
|
182
|
+
#v(1fr) // flexible vertical space
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Alignment
|
|
186
|
+
|
|
187
|
+
Control content positioning within its container. Combine horizontal and vertical alignment with `+`.
|
|
188
|
+
|
|
189
|
+
```typst
|
|
190
|
+
#set align(center) // center align
|
|
191
|
+
#set align(left) // left align
|
|
192
|
+
#set align(right) // right align
|
|
193
|
+
#set align(center + horizon) // center both axes
|
|
194
|
+
|
|
195
|
+
// Inline alignment
|
|
196
|
+
#align(center)[Centered text]
|
|
197
|
+
#align(right)[Right-aligned]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Blocks and Boxes
|
|
201
|
+
|
|
202
|
+
Containers for grouping and styling content. Blocks are block-level (cause line breaks); boxes are inline.
|
|
203
|
+
|
|
204
|
+
### Block
|
|
205
|
+
|
|
206
|
+
Block-level containers with optional background, border, and padding. Use for callouts, sidebars, or any visually distinct sections.
|
|
207
|
+
|
|
208
|
+
```typst
|
|
209
|
+
#block(
|
|
210
|
+
width: 100%,
|
|
211
|
+
fill: luma(230),
|
|
212
|
+
inset: 1em,
|
|
213
|
+
radius: 4pt,
|
|
214
|
+
[Block content]
|
|
215
|
+
)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Box (Inline)
|
|
219
|
+
|
|
220
|
+
Inline containers that flow with text. Use for highlighting words or adding inline decorations.
|
|
221
|
+
|
|
222
|
+
```typst
|
|
223
|
+
#box(
|
|
224
|
+
fill: yellow,
|
|
225
|
+
inset: 4pt,
|
|
226
|
+
[Highlighted]
|
|
227
|
+
)
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Grid Layout
|
|
231
|
+
|
|
232
|
+
Grids arrange content in rows and columns without table styling. Ideal for multi-column layouts, card layouts, or any structured arrangement.
|
|
233
|
+
|
|
234
|
+
### Basic Grid
|
|
235
|
+
|
|
236
|
+
Specify column widths as an array. Content fills cells left-to-right, top-to-bottom.
|
|
237
|
+
|
|
238
|
+
```typst
|
|
239
|
+
#grid(
|
|
240
|
+
columns: (1fr, 1fr), // two equal columns
|
|
241
|
+
gutter: 1em, // gap between cells
|
|
242
|
+
[Column 1], [Column 2],
|
|
243
|
+
[Row 2 Col 1], [Row 2 Col 2],
|
|
244
|
+
)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Grid with Varying Columns
|
|
248
|
+
|
|
249
|
+
Mix `auto` (content-sized), fixed lengths, and `fr` (fractional) units for flexible layouts.
|
|
250
|
+
|
|
251
|
+
```typst
|
|
252
|
+
#grid(
|
|
253
|
+
columns: (auto, 1fr, 2fr), // auto + proportional
|
|
254
|
+
rows: (auto, 1fr),
|
|
255
|
+
[A], [B], [C],
|
|
256
|
+
[D], [E], [F],
|
|
257
|
+
)
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## Tables
|
|
261
|
+
|
|
262
|
+
Tables include default borders and padding. Use for displaying structured data that benefits from visual separation.
|
|
263
|
+
|
|
264
|
+
### Basic Table
|
|
265
|
+
|
|
266
|
+
Specify column count or widths. Content is placed sequentially into cells.
|
|
267
|
+
|
|
268
|
+
```typst
|
|
269
|
+
#table(
|
|
270
|
+
columns: 3,
|
|
271
|
+
[Header 1], [Header 2], [Header 3],
|
|
272
|
+
[Cell 1], [Cell 2], [Cell 3],
|
|
273
|
+
[Cell 4], [Cell 5], [Cell 6],
|
|
274
|
+
)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
### Styled Table
|
|
278
|
+
|
|
279
|
+
Customize appearance with fill functions (for alternating rows), alignment, and header styling.
|
|
280
|
+
|
|
281
|
+
```typst
|
|
282
|
+
#table(
|
|
283
|
+
columns: (auto, 1fr, 1fr),
|
|
284
|
+
inset: 10pt,
|
|
285
|
+
align: horizon,
|
|
286
|
+
fill: (x, y) => if y == 0 { luma(230) },
|
|
287
|
+
table.header(
|
|
288
|
+
[*Name*], [*Value*], [*Description*],
|
|
289
|
+
),
|
|
290
|
+
[Item A], [100], [First item],
|
|
291
|
+
[Item B], [200], [Second item],
|
|
292
|
+
)
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
### Table Spanning
|
|
296
|
+
|
|
297
|
+
Use `table.cell` with `colspan` or `rowspan` to merge cells across columns or rows.
|
|
298
|
+
|
|
299
|
+
```typst
|
|
300
|
+
#table(
|
|
301
|
+
columns: 3,
|
|
302
|
+
table.cell(colspan: 2)[Spans 2 columns], [Single],
|
|
303
|
+
table.cell(rowspan: 2)[Spans 2 rows], [A], [B],
|
|
304
|
+
[C], [D],
|
|
305
|
+
)
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Figures
|
|
309
|
+
|
|
310
|
+
Figures wrap content with automatic numbering and captions. Add labels for cross-referencing with `@label` syntax.
|
|
311
|
+
|
|
312
|
+
```typst
|
|
313
|
+
#figure(
|
|
314
|
+
image("diagram.png", width: 80%),
|
|
315
|
+
caption: [A descriptive caption],
|
|
316
|
+
) <fig:diagram>
|
|
317
|
+
|
|
318
|
+
// Reference: @fig:diagram
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
## Columns
|
|
322
|
+
|
|
323
|
+
Create multi-column text flow. Use `colbreak()` to force content to the next column.
|
|
324
|
+
|
|
325
|
+
```typst
|
|
326
|
+
#set page(columns: 2) // two-column layout
|
|
327
|
+
|
|
328
|
+
// Or inline
|
|
329
|
+
#columns(2, gutter: 1em)[
|
|
330
|
+
First column content.
|
|
331
|
+
#colbreak()
|
|
332
|
+
Second column content.
|
|
333
|
+
]
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
## Positioning
|
|
337
|
+
|
|
338
|
+
Control exact element placement when automatic flow isn't sufficient.
|
|
339
|
+
|
|
340
|
+
### Place (Absolute Positioning)
|
|
341
|
+
|
|
342
|
+
Position elements relative to page or container edges. Does not affect document flow.
|
|
343
|
+
|
|
344
|
+
```typst
|
|
345
|
+
#place(
|
|
346
|
+
top + right,
|
|
347
|
+
dx: -1cm,
|
|
348
|
+
dy: 1cm,
|
|
349
|
+
[Positioned element]
|
|
350
|
+
)
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Move (Relative Positioning)
|
|
354
|
+
|
|
355
|
+
Shift elements from their natural position while maintaining document flow.
|
|
356
|
+
|
|
357
|
+
```typst
|
|
358
|
+
#move(dx: 5pt, dy: -3pt)[Shifted text]
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Transforms
|
|
362
|
+
|
|
363
|
+
Apply geometric transformations to content. Useful for decorative effects or specialized layouts.
|
|
364
|
+
|
|
365
|
+
```typst
|
|
366
|
+
#rotate(45deg)[Rotated]
|
|
367
|
+
#scale(x: 150%, y: 100%)[Scaled]
|
|
368
|
+
#skew(ax: 10deg)[Skewed]
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## Length Units
|
|
372
|
+
|
|
373
|
+
Typst supports both absolute and relative length units. Use `em` for font-relative sizing, `fr` for flexible space distribution.
|
|
374
|
+
|
|
375
|
+
| Unit | Description |
|
|
376
|
+
|------|-------------|
|
|
377
|
+
| `pt` | Points (1/72 inch) |
|
|
378
|
+
| `mm` | Millimeters |
|
|
379
|
+
| `cm` | Centimeters |
|
|
380
|
+
| `in` | Inches |
|
|
381
|
+
| `em` | Relative to font size |
|
|
382
|
+
| `%` | Percentage of container |
|
|
383
|
+
| `fr` | Fraction of remaining space |
|
|
384
|
+
|
|
385
|
+
## Page Breaks
|
|
386
|
+
|
|
387
|
+
Control page flow. Use `weak: true` to only break if there's already content on the page.
|
|
388
|
+
|
|
389
|
+
```typst
|
|
390
|
+
#pagebreak() // force page break
|
|
391
|
+
#pagebreak(weak: true) // only if needed
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
## Padding
|
|
395
|
+
|
|
396
|
+
Add space around content. Use named parameters for asymmetric padding.
|
|
397
|
+
|
|
398
|
+
```typst
|
|
399
|
+
#pad(x: 1em, y: 0.5em)[Padded content]
|
|
400
|
+
#pad(left: 2em)[Left-padded only]
|
|
401
|
+
```
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# Typst Math Reference
|
|
2
|
+
|
|
3
|
+
Mathematical notation syntax in Typst.
|
|
4
|
+
|
|
5
|
+
## Function Parameters
|
|
6
|
+
|
|
7
|
+
These functions provide fine-grained control over mathematical typesetting when the shorthand syntax isn't sufficient.
|
|
8
|
+
|
|
9
|
+
### `equation` Function
|
|
10
|
+
|
|
11
|
+
The wrapper for all math content. Usually implicit, but use explicitly for numbering control or advanced configuration.
|
|
12
|
+
|
|
13
|
+
| Parameter | Type | Default | Description |
|
|
14
|
+
|-----------|------|---------|-------------|
|
|
15
|
+
| `block` | bool | `false` | Display as block (centered) equation |
|
|
16
|
+
| `numbering` | none \| str \| func | `none` | Equation number format: `"(1)"`, `"[1]"` |
|
|
17
|
+
| `number-align` | alignment | `end + horizon` | Number alignment |
|
|
18
|
+
| `supplement` | auto \| none \| content | `auto` | Reference prefix (e.g., "Equation") |
|
|
19
|
+
| `body` | content | required | Equation content |
|
|
20
|
+
|
|
21
|
+
### `mat` Function (Matrix)
|
|
22
|
+
|
|
23
|
+
Creates matrices with customizable delimiters and alignment. Rows are separated by semicolons, columns by commas.
|
|
24
|
+
|
|
25
|
+
| Parameter | Type | Default | Description |
|
|
26
|
+
|-----------|------|---------|-------------|
|
|
27
|
+
| `delim` | none \| str | `"("` | Delimiter: `"("`, `"["`, `"{"`, `"|"`, `"||"` |
|
|
28
|
+
| `align` | alignment | `center` | Cell alignment |
|
|
29
|
+
| `augment` | none \| int \| dict | `none` | Augmentation line position |
|
|
30
|
+
| `gap` | relative | `0pt` | Gap between cells |
|
|
31
|
+
| `row-gap` | relative | `0.2em` | Gap between rows |
|
|
32
|
+
| `column-gap` | relative | `0.5em` | Gap between columns |
|
|
33
|
+
| `rows` | content | required | Matrix rows (`;` separated) |
|
|
34
|
+
|
|
35
|
+
### `vec` Function (Vector)
|
|
36
|
+
|
|
37
|
+
Creates column vectors. Elements are stacked vertically with configurable delimiters.
|
|
38
|
+
|
|
39
|
+
| Parameter | Type | Default | Description |
|
|
40
|
+
|-----------|------|---------|-------------|
|
|
41
|
+
| `delim` | none \| str | `"("` | Delimiter: `"("`, `"["`, `"{"`, `"|"`, `"||"` |
|
|
42
|
+
| `align` | alignment | `center` | Element alignment |
|
|
43
|
+
| `gap` | relative | `0.2em` | Gap between elements |
|
|
44
|
+
| `children` | content | required | Vector elements (`,` separated) |
|
|
45
|
+
|
|
46
|
+
### `frac` Function (Fraction)
|
|
47
|
+
|
|
48
|
+
Explicit fraction function for when the `/` shorthand produces unwanted grouping or styling.
|
|
49
|
+
|
|
50
|
+
| Parameter | Type | Default | Description |
|
|
51
|
+
|-----------|------|---------|-------------|
|
|
52
|
+
| `num` | content | required | Numerator |
|
|
53
|
+
| `denom` | content | required | Denominator |
|
|
54
|
+
|
|
55
|
+
### `cases` Function
|
|
56
|
+
|
|
57
|
+
Creates piecewise function definitions with conditions. Each case is separated by commas.
|
|
58
|
+
|
|
59
|
+
| Parameter | Type | Default | Description |
|
|
60
|
+
|-----------|------|---------|-------------|
|
|
61
|
+
| `delim` | str | `"{"` | Delimiter |
|
|
62
|
+
| `reverse` | bool | `false` | Place delimiter on right |
|
|
63
|
+
| `gap` | relative | `0.2em` | Gap between rows |
|
|
64
|
+
| `children` | content | required | Case rows (`,` separated) |
|
|
65
|
+
|
|
66
|
+
### `cancel` Function
|
|
67
|
+
|
|
68
|
+
Draws a strikethrough line through content, commonly used to show cancellation in algebraic simplification.
|
|
69
|
+
|
|
70
|
+
| Parameter | Type | Default | Description |
|
|
71
|
+
|-----------|------|---------|-------------|
|
|
72
|
+
| `body` | content | required | Content to cancel |
|
|
73
|
+
| `length` | relative | `100% + 3pt` | Line length |
|
|
74
|
+
| `inverted` | bool | `false` | Invert line angle |
|
|
75
|
+
| `cross` | bool | `false` | Draw X instead of line |
|
|
76
|
+
| `angle` | auto \| angle | `auto` | Line angle |
|
|
77
|
+
| `stroke` | stroke | `0.5pt` | Line stroke |
|
|
78
|
+
|
|
79
|
+
### `accent` Function
|
|
80
|
+
|
|
81
|
+
Places diacritical marks above mathematical symbols. Use for vectors, estimates, averages, and other notations.
|
|
82
|
+
|
|
83
|
+
| Parameter | Type | Default | Description |
|
|
84
|
+
|-----------|------|---------|-------------|
|
|
85
|
+
| `base` | content | required | Base content |
|
|
86
|
+
| `accent` | str \| content | required | Accent: `hat`, `tilde`, `macron`, `dot`, `dot.double`, `arrow` |
|
|
87
|
+
| `size` | auto \| relative | `auto` | Accent size |
|
|
88
|
+
|
|
89
|
+
## Math Mode Entry
|
|
90
|
+
|
|
91
|
+
The presence of spaces after `$` determines whether math renders inline or as a centered block. This is the most important distinction for equation layout.
|
|
92
|
+
|
|
93
|
+
| Type | Syntax | Result |
|
|
94
|
+
|------|--------|--------|
|
|
95
|
+
| Inline | `$x^2$` | Inline equation |
|
|
96
|
+
| Block | `$ x^2 $` (with spaces) | Centered equation |
|
|
97
|
+
|
|
98
|
+
## Basic Notation
|
|
99
|
+
|
|
100
|
+
Core syntax for mathematical expressions. Use parentheses to group complex sub/superscripts.
|
|
101
|
+
|
|
102
|
+
### Subscripts and Superscripts
|
|
103
|
+
|
|
104
|
+
Use `_` for subscripts and `^` for superscripts. Wrap multi-character expressions in parentheses.
|
|
105
|
+
|
|
106
|
+
```typst
|
|
107
|
+
$x^2$ // x squared
|
|
108
|
+
$x_1$ // x subscript 1
|
|
109
|
+
$x_1^2$ // both
|
|
110
|
+
$x^(2n)$ // grouped exponent
|
|
111
|
+
$x_(i j)$ // grouped subscript
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Fractions
|
|
115
|
+
|
|
116
|
+
The `/` operator creates fractions automatically. Parentheses control grouping. Use `frac()` for explicit control.
|
|
117
|
+
|
|
118
|
+
```typst
|
|
119
|
+
$a/b$ // simple fraction
|
|
120
|
+
$(a + b)/(c + d)$ // grouped fraction
|
|
121
|
+
$frac(a, b)$ // explicit fraction function
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Roots
|
|
125
|
+
|
|
126
|
+
Square roots use `sqrt()`. For other roots, use `root(n, x)` where `n` is the root degree.
|
|
127
|
+
|
|
128
|
+
```typst
|
|
129
|
+
$sqrt(x)$ // square root
|
|
130
|
+
$root(3, x)$ // cube root
|
|
131
|
+
$root(n, x)$ // nth root
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## Common Functions
|
|
135
|
+
|
|
136
|
+
Standard mathematical functions are recognized automatically and rendered in upright text. Limits and bounds attach with subscripts.
|
|
137
|
+
|
|
138
|
+
```typst
|
|
139
|
+
$sin(x)$, $cos(x)$, $tan(x)$
|
|
140
|
+
$log(x)$, $ln(x)$, $exp(x)$
|
|
141
|
+
$lim_(x -> 0) f(x)$
|
|
142
|
+
$max(a, b)$, $min(a, b)$
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Sums and Products
|
|
146
|
+
|
|
147
|
+
Large operators like summation, product, and integral accept limits via subscript/superscript syntax. Use `dif` for differential notation.
|
|
148
|
+
|
|
149
|
+
```typst
|
|
150
|
+
$sum_(i=1)^n i$ // summation
|
|
151
|
+
$product_(i=1)^n i$ // product
|
|
152
|
+
$integral_0^1 f(x) dif x$ // integral
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Matrices and Vectors
|
|
156
|
+
|
|
157
|
+
Matrices use semicolons for row breaks and commas for column separation. Vectors are single-column matrices.
|
|
158
|
+
|
|
159
|
+
```typst
|
|
160
|
+
// Vector
|
|
161
|
+
$vec(x, y, z)$
|
|
162
|
+
|
|
163
|
+
// Matrix
|
|
164
|
+
$mat(
|
|
165
|
+
1, 2, 3;
|
|
166
|
+
4, 5, 6;
|
|
167
|
+
7, 8, 9;
|
|
168
|
+
)$
|
|
169
|
+
|
|
170
|
+
// Matrix with delimiters
|
|
171
|
+
$mat(delim: "[",
|
|
172
|
+
a, b;
|
|
173
|
+
c, d;
|
|
174
|
+
)$
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Brackets and Delimiters
|
|
178
|
+
|
|
179
|
+
Use `lr()` for auto-scaling delimiters that grow with content. Special functions like `abs()`, `norm()`, `floor()`, and `ceil()` provide semantic delimiters.
|
|
180
|
+
|
|
181
|
+
```typst
|
|
182
|
+
$(a + b)$ // parentheses
|
|
183
|
+
$[a + b]$ // brackets
|
|
184
|
+
${a + b}$ // braces (use lr for scaling)
|
|
185
|
+
$lr(( a/b ))$ // auto-scaling
|
|
186
|
+
$abs(x)$ // absolute value
|
|
187
|
+
$norm(x)$ // norm
|
|
188
|
+
$floor(x)$ // floor
|
|
189
|
+
$ceil(x)$ // ceiling
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## Greek Letters
|
|
193
|
+
|
|
194
|
+
Greek letters are written by name without any prefix. Lowercase names produce lowercase letters; capitalize the first letter for uppercase.
|
|
195
|
+
|
|
196
|
+
| Letter | Typst | Letter | Typst |
|
|
197
|
+
|--------|-------|--------|-------|
|
|
198
|
+
| α | `alpha` | ν | `nu` |
|
|
199
|
+
| β | `beta` | ξ | `xi` |
|
|
200
|
+
| γ | `gamma` | π | `pi` |
|
|
201
|
+
| δ | `delta` | ρ | `rho` |
|
|
202
|
+
| ε | `epsilon` | σ | `sigma` |
|
|
203
|
+
| ζ | `zeta` | τ | `tau` |
|
|
204
|
+
| η | `eta` | υ | `upsilon` |
|
|
205
|
+
| θ | `theta` | φ | `phi` |
|
|
206
|
+
| ι | `iota` | χ | `chi` |
|
|
207
|
+
| κ | `kappa` | ψ | `psi` |
|
|
208
|
+
| λ | `lambda` | ω | `omega` |
|
|
209
|
+
| μ | `mu` | | |
|
|
210
|
+
|
|
211
|
+
Capital letters: `Alpha`, `Beta`, `Gamma`, `Delta`, `Theta`, `Lambda`, `Pi`, `Sigma`, `Phi`, `Psi`, `Omega`
|
|
212
|
+
|
|
213
|
+
## Operators and Symbols
|
|
214
|
+
|
|
215
|
+
Common mathematical operators and symbols. Use these names directly in math mode without any prefix.
|
|
216
|
+
|
|
217
|
+
```typst
|
|
218
|
+
$+$, $-$, $times$, $div$
|
|
219
|
+
$=$, $!=$, $<$, $>$, $<=$, $>=$
|
|
220
|
+
$approx$, $equiv$, $prop$
|
|
221
|
+
$in$, $not in$, $subset$, $supset$
|
|
222
|
+
$union$, $sect$ // set operations
|
|
223
|
+
$and$, $or$, $not$ // logical
|
|
224
|
+
$forall$, $exists$ // quantifiers
|
|
225
|
+
$infinity$, $emptyset$
|
|
226
|
+
$arrow$, $arrow.l$, $arrow.double$
|
|
227
|
+
$partial$, $nabla$ // calculus
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## Alignment
|
|
231
|
+
|
|
232
|
+
Use `&` as alignment points and `\` for line breaks. Multiple equations align at the `&` symbols across lines.
|
|
233
|
+
|
|
234
|
+
```typst
|
|
235
|
+
// Multi-line aligned equations
|
|
236
|
+
$ x &= 2 + 3 \
|
|
237
|
+
&= 5 $
|
|
238
|
+
|
|
239
|
+
// Equation numbering
|
|
240
|
+
#set math.equation(numbering: "(1)")
|
|
241
|
+
$ E = m c^2 $
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Cases
|
|
245
|
+
|
|
246
|
+
Piecewise function notation using the `cases` function. Separate conditions with `&` and cases with commas.
|
|
247
|
+
|
|
248
|
+
```typst
|
|
249
|
+
$f(x) = cases(
|
|
250
|
+
0 &"if" x < 0,
|
|
251
|
+
1 &"if" x >= 0,
|
|
252
|
+
)$
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Text in Math
|
|
256
|
+
|
|
257
|
+
Wrap regular text in quotes to include it in equations. Quoted text renders in the document's text font rather than math italics.
|
|
258
|
+
|
|
259
|
+
```typst
|
|
260
|
+
$x "where" x > 0$
|
|
261
|
+
$"area" = pi r^2$
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## Accents
|
|
265
|
+
|
|
266
|
+
Mathematical accents and diacritical marks for vectors, estimates, derivatives, and other notations.
|
|
267
|
+
|
|
268
|
+
```typst
|
|
269
|
+
$accent(x, hat)$ // x̂
|
|
270
|
+
$accent(x, tilde)$ // x̃
|
|
271
|
+
$accent(x, macron)$ // x̄ (bar)
|
|
272
|
+
$accent(x, dot)$ // ẋ
|
|
273
|
+
$accent(x, dot.double)$ // ẍ
|
|
274
|
+
$accent(x, arrow)$ // x→
|
|
275
|
+
$overline(x y)$ // overline
|
|
276
|
+
$underline(x y)$ // underline
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
## Cancel and Strikethrough
|
|
280
|
+
|
|
281
|
+
Show algebraic cancellation or struck-out terms. Useful for demonstrating simplification steps.
|
|
282
|
+
|
|
283
|
+
```typst
|
|
284
|
+
$cancel(x)$ // strikethrough
|
|
285
|
+
$cancel(x, cross: true)$ // X mark
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## Spacing in Math
|
|
289
|
+
|
|
290
|
+
Typst automatically handles spacing in math mode. Override with explicit spaces when needed for clarity.
|
|
291
|
+
|
|
292
|
+
```typst
|
|
293
|
+
$a b$ // implicit multiplication (thin space)
|
|
294
|
+
$a " " b$ // explicit space
|
|
295
|
+
$a med b$ // medium space
|
|
296
|
+
$a thick b$ // thick space
|
|
297
|
+
```
|