A web edition for academic documents written in Typst: a paper becomes one self-contained HTML page, a thesis becomes a searchable site, without touching the sections. Mathematics is native MathML. The same output packages as an EPUB book.
The repository holds:
lib/— the web layer you copy into your project:web.typ(show rules and page functions),web-content.cssandweb.css,web.jsfor multi-page sites, andepub.py, which turns a built page or site into an EPUB;tools/check.py— compiles a web edition and reports what did not reach the HTML;examples/— a paper and a bilingual thesis, ready to copy;src/— the guide, which also covers LaTeX conversion, bilingual PDF output and GitHub Pages deployment.
It targets Typst 0.15.1. HTML export is still experimental in Typst: pin the version.
- PhD thesis (2004) — Web Graphs, PageRank-like Importance Measures (source)
- HDR thesis (2009) — On Peer-to-peer, Content Distribution, Acyclic Preference Networks (source)
-
Copy
lib/web.typ,lib/web-content.cssandlib/web.cssinto aweb/folder of your project. -
Write a
web.typentry next to your PDF entry file, on the model ofexamples/article/web.typ: your content rules, then#show: web-rules, then#show: article.with(...), then the same#includes. -
Compile and check:
typst compile --features html web.typ paper.html uv run tools/check.py web.typ
- Copy
examples/thesisas your new project. - Edit
templates/meta-data.typ, replace the chapters, and list your pages inmain-html.typ(onechapter(...)per page). - Run
typst compile main.typfor the PDF,uv run web/build.pyfor the site, its PDFs and its EPUBs.
The guide explains each step, and the one rule that matters: the order of the show rules in a web entry file.
uv run --with pytest pytest -q # compiles the examples and checks their output
EPUBCHECK=path/to/epubcheck.jar uv run --with pytest pytest -q # also validates the EPUBs
uv run tools/sync.py # refreshes the copies of lib/ kept in examples/Guide, layer, tools and examples are licensed under the MIT License.