# Hiccup → Typst Mapping Reference ## Audit of Current Tags ### ✅ Valid - Direct Typst Functions | Hiccup | Typst | Notes | |--------|-------|-------| | `[:heading {:level 2} "Text"]` | `#heading(level: 2)[Text]` | ✅ Works | | `[:strong "text"]` | `#strong[text]` | ✅ Works | | `[:emph "text"]` | `#emph[text]` | ✅ Works | | `[:link {:dest "url"} "text"]` | `#link("url")[text]` | ✅ Works | | `[:image {:width "50%"} "path.png"]` | `#image("path.png", width: 50%)` | ✅ Works | | `[:block {:inset "1em"} ...]` | `#block(inset: 1em)[...]` | ✅ Works | | `[:bibliography "refs.bib"]` | `#bibliography("refs.bib")` | ✅ Works | ### ❌ Invalid - Don't Exist in Typst | Bad Hiccup | Problem | Fix | |------------|---------|-----| | `[:p "text"]` | No paragraph function | Just use strings, paragraphs are implicit | | `[:item "text"]` | Not a function | Items are args to `list()` | | `[:cell "text"]` | Not a function | Cells are args to `table()` | | `[:div ...]` | HTML, not Typst | Use `[:block ...]` | | `[:span ...]` | HTML, not Typst | Just inline content, or `[:box ...]` | | `[:aside ...]` | Doesn't exist | Use `[:block ...]` with styling | | `[:section ...]` | Doesn't exist | Just use headings | | `[:doc ...]` | Doesn't exist | Top-level is just content | | `[:table-row ...]` | Doesn't exist | Tables are flat | ### ⚠️ Needs Adjustment | Current | Problem | Correct | |---------|---------|---------| | `[:linebreak]` | Function name | `[:linebreak]` → `#linebreak()` ✅ actually works | | `[:h-space "2em"]` | Wrong name | `[:h "2em"]` → `#h(2em)` | | `[:figure [:image ...] [:caption ...]]` | Caption isn't a child | See below | | `[:math "x^2"]` | Need to distinguish inline/block | `$x^2$` vs `$ x^2 $` | | `[:code {:lang "py"} "..."]` | Function is `raw` | `#raw(lang: "python", "...")` | | `[:ref :label]` | Takes label not string | `#ref(