Reactive Notebooks as Publishable Documents
This notebook demonstrates Slate's document-metadata roles — title, abstract,
and bibliography — authored as ordinary cells in natural reading order. Each role
renders in place in the live notebook, and every export target (article PDF, slide
deck, HTML) interprets the role for placement: title and abstract are hoisted into the
title block, and the bibliography is collected for the references section.
Introduction
A Slate notebook is a reactive document. With front-matter roles it is also a publishable artifact — the same cells you compute with become a typeset article. Prior work on literate computing [1] and reproducible research motivates keeping prose, code, and citations in one live document.
Histogram of the $n = 1000$ standard-normal draws — a caption-tagged cell binds to the
figure above (auto-numbered, and referenceable as [@fig:hist]). Captions are ordinary
markdown, so bold, code, and math like $\mu \approx 0$ all render.
Method
We draw $n = 1000$ samples from a standard normal and summarize them (see Figure 1). The interactive table below is computed live; in the exported PDF it is frozen to a static table.
| x | x2 | sqrt_x |
|---|---|---|
| 1 | 1 | 1.0 |
| 2 | 4 | 1.414 |
| 3 | 9 | 1.732 |
| 4 | 16 | 2.0 |
| 5 | 25 | 2.236 |
Discussion
Citations link to the bibliography in the live notebook and render in the chosen bibstyle
on export. Each row shows what you type (left) and how it renders (right):
| You write | Renders |
|---|---|
[@turing1936computable] | [3] |
[@knuth1984literate, p. 97] | [1, p. 97] |
[@knuth1984literate; @turing1936computable] | [1][3] |
@knuth1984literate (prose) | [1] |
(The left column is in backticks, so it stays literal; the right column is a real citation.)
Citation styles
The reference style is a per-notebook setting (Settings → Citation style, persisted in
the Slate.config footer as bibstyle). Slate uses Typst's CSL engine, so the same
notebook can render in any of these — switch and re-export to compare:
bibstyle | citation | reference list |
|---|---|---|
ieee (default) | [1] | numbered |
apa | (Knuth, 1984) | author–date |
chicago-author-date | (Knuth 1984) | author–date |
chicago-notes | footnote¹ | notes + bibliography |
mla | (Knuth) | works cited |
nature | superscript¹ | numbered |
vancouver | (1) | numbered |
harvard-cite-them-right | (Knuth, 1984) | author–date |
References
- Donald E. Knuth. Literate Programming. 1984.
- Alan M. Turing. On Computable Numbers, with an Application to the Entscheidungsproblem. 1936.