Hello, notebook
Every post here is a single Typst file. The text is typeset by Typst, the drawings are stuck on afterwards, and the paper is โ well, the paper is CSS, but it is trying its best.
This is a sample post that exercises everything the layout can do, so there is something to look at while the real writing gets done.
A sum worth doodling about
The story goes that a schoolteacher, wanting a quiet hour, asked the class to add up every whole number from 1 to 100. One pupil wrote the answer down almost immediately. The trick is to write the sum twice, once forwards and once backwards, and add the two rows column by column:
Every column comes to , and there are of them, so
For that gives , and one very annoyed teacher. The same pairing idea is why the average of an evenly spaced list is just the average of its first and last entries.
Checking it the boring way
Code blocks work too, with syntax highlighting done by Typst at build time:
def triangle(n: int) -> int:
return n * (n + 1) // 2
assert triangle(100) == sum(range(1, 101)) == 5050So do footnotes1, emphasis, strong text, inline code, and lists:
- notes go in the margin on wide screens,
- tuck into the text on medium ones,
- and drop between paragraphs on phones.
- 1Which end up down here, at the bottom of the page.