Galley

Specimen

Typst, set as a page you can read, hover, and follow into the source.

Your name

1 The page

A galley is the proof you pull while the type is still being set. This repository is that proof for a Typst document: one source, three readings.

OUTPUT

PDF

mise run pdf writes build/specimen.pdf. The same manual() show rule sets the title page, the contents, and the running header. Nothing that exists only for the browser is printed: symbol labels and the source-root list stay in the HTML.

OUTPUT

One HTML file

mise run html writes build/manual.html. Typstโ€™s HTML export is still experimental. Galley wraps that file with a stylesheet, an equation inspector, and source links, then serves it.

OUTPUT

Live page

mise run dev serves the page and swaps in a new document when a .typ file changes. The theme stays on screen while Typst compiles. The page follows the system light and dark appearance.

The typeface is New York when it is installed, and Palatino or Georgia otherwise. Optical size follows the font size. Body text is 16px on a measure of about seventy characters.

Headings in the contents keep their numbers, and the number is not underlined. A chapter title should not open with a digit, or it collides with the heading number.

2 Equations

Click a formula. The rest of it fades, and a symbol that has a label shows only that label. Labels belong to the equation, so the same letter can mean two things.

A clothoid, with station ๐‘ :

๐œ…(๐‘ )=๐œ…0+๐œ…1โˆ’๐œ…0๐ฟ(๐‘ โˆ’๐‘ 0)

A time step, where ๐‘” is gravity:

ฮ”๐‘กโ‰คCFLยทฮ”๐‘ฅ๐‘”โ„Ž

A grade, where ๐‘” is not gravity:

๐‘”(๐‘ )=๐‘1โˆ’๐‘0๐ฟvc

#gloss takes a dictionary of symbol keys and short labels, then the math. Greek letters and ฮ” need quotes in the key ("ฮบ", "ฮ”t"). Plain names such as h do not. On a PDF the wrapper disappears and only the formula is set.

#gloss((g: "grade", s: "station"))[
  $ g(s) = (Z_1 - Z_0) / L_"vc" $
]

3 Source links

A path written in code, or a bare path set with mono, becomes a link when it names a file under a directory this document declares.

examples/โ€‹hello.py is the specimen script. The page server is site/vite.config.js. While mise run dev is running, a click opens that file in Cursor. On the published site the same words link to the file on GitHub.

The declaration is one call, usually next to the rest of the front matter:

#code-roots((".",), repo: "https://github.com/mate-h/galley")

"." is this repository. A path such as ~/git/notes is allowed too, and only the local server can open it. The published page links files that live inside the repository. When a name occurs once, the basename is enough: hello.py.

Written asOpens
examples/hello.pythe specimen script
site/vite.config.jsthe Vite plugin that compiles Typst
hello.pythe same script, by basename
~/โ€‹git/โ€‹notesonly on your machine, and only if that directory is listed

An inline mark that is not a file stays plain. ๐‘” here is grade, and CFL in the time-step formula is a symbol, not a path.

4 Figures

Typst draws the figure. The HTML export inlines it as SVG. Fills and strokes are baked into the file, so the dark theme recolors this specimenโ€™s palette in site/manual.css. Use the same hexes, or change the selectors when you change the palette.

Figureย 1: One Typst source feeds the live page and the PDF. Saving a source file swaps the page in place. The dashed arrow is the edit coming back.

A swatch sits in the line, in either theme, without a figure around it.