A Book Written in Types
PDF

Appendices

Prelude reference

Everything a chapter can use after #import "/book/lib/prelude.typ": *, with its output shown inline. The source of this chapter is the copy-paste source for each helper.

Callouts

#note[...], #tip[...], #warning[...] and #caution[...] take an optional title:; pass title: "" to drop the heading entirely.

Defined terms

#term[...] marks the place where the book defines a word: a functor becomes a <dfn> on the web and bold italic in print, so a glossary can be generated from the same markup later.

Output-specific content

#web-only[...] and #print-only[...] include content in one output only.

This sentence only exists on the website.

Code from real files

#snippet(path, tag: none, lang: none) reads a file under code/ and quotes one marked region of it. Regions are delimited by [name] and [/name] inside comments, are dedented, and must exist:

#snippet("/code/examples/types.rs", tag: "newtype")

Everything else

The rest is plain Typst: headings, lists, #figure, #table, #image, #link, @labels, #footnote, and math. The Typst reference applies unchanged.