- Nix 64.5%
- Typst 35.5%
- equation dual-rendering (SVG+MathML) - compile script - readme instructions - typst manifest |
||
|---|---|---|
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| h.typ | ||
| preamble.typ | ||
| README.md | ||
| typst.toml | ||
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 exporterbox— silently produces no outputblock— silently produces no outputrotate/scale/skew— no effecttablewithfill,stroke,gutter— styles ignoredimagewith 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