No description
  • Nix 64.5%
  • Typst 35.5%
Find a file
Dzuchun 7856fe5162 Initial version
- equation dual-rendering (SVG+MathML)
- compile script
- readme instructions
- typst manifest
2026-06-20 10:45:04 +01:00
.gitignore Initial version 2026-06-20 10:45:04 +01:00
flake.lock Initial version 2026-06-20 10:45:04 +01:00
flake.nix Initial version 2026-06-20 10:45:04 +01:00
h.typ Initial version 2026-06-20 10:45:04 +01:00
preamble.typ Initial version 2026-06-20 10:45:04 +01:00
README.md Initial version 2026-06-20 10:45:04 +01:00
typst.toml Initial version 2026-06-20 10:45:04 +01:00

A helper code to write simple web articles in Typst

Usage

Put on top of your article code:

#import "https://git.dzuchun.ing/dzu/htyp/raw/branch/master/h.typ": helper-function

#helper-function(...)[...]

Helper functions described in "Helper functions", but make sure to NOT use Typst functions described in "Broken functions".

As long as you follow the rules, regular Typst output can be treated as a preview for the resulting page.

Helper functions

Broken functions

Some Typst functions produce no output or crash when compiling to HTML. This is due to Typst's HTML backend being experimental and incomplete — it converts content to semantic HTML/MathML/SVG rather than simulating page layout, so page-geometry features (page, box, block etc.) have no meaningful HTML equivalent yet.

Known broken functions:

  • page — crashes the HTML exporter
  • box — silently produces no output
  • block — silently produces no output
  • rotate / scale / skew — no effect
  • table with fill, stroke, gutter — styles ignored
  • image with non-raster formats (e.g. SVG) — may not render

To circumvent these issues, you need to use special html backend functions:

html.elem("div", attrs: (...), style: "...")[...]

or make use of "Helper functions" provided in this repo

For more info, see tracking issue: https://github.com/typst/typst/issues/5512